1.標準オブジェクト
<!DOCTYPE HTML >
< HTML LANG = "EN" >
< 頭> < メタ文字コード= "UTF-8" > < タイトル> のJavaScript学习< / TITLE> < スクリプト> '厳格な使用'; コンソール。(ログtypeof演算123)。 //数値コンソール。ログ(typeof演算"123")。 //文字列のコンソール。ログ(typeof演算真)。 //ブールコンソール。
NaNの); //数値コンソール。ログ(typeof演算[])。 //オブジェクトのコンソール。ログ(typeof演算{})。 //オブジェクトのコンソール。(ログインTYPEOF 。数学ABS); //関数コンソール。ログ(typeof演算未定義)。 //未定義< /スクリプト> < / HEAD> < 身体> < / BODY> < / HTML>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript学习</title>
<script>
'use strict';
var time = new Date();
console.log(time.getFullYear()) //年
console.log(time.getMonth()) //月 注意:是0-11月
console.log(time.getDate()) //日
console.log(time.getDay()) //周几
console.log(time.getHours()) //时
console.log(time.getMinutes()) //分
console.log(time.getSeconds()) //秒
console.log(time.getTime()) //时间戳 全世界统一,从1970年1月1日0时0分0秒开始,毫秒计数
console.log(new Date(1582191191203)) //秒
</script>
</head>
<body>
</body>
</html>