<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>study</title>
</head>
<body>
<script>
window.onload = function () {
console.log(typeof 1)
console.log(typeof "1")
console.log(typeof true)
console.log(Array.isArray([1, 2, 3]))
console.log(Object.prototype.toString.call(new Date()))
console.log(Object.prototype.toString.call(Array()))
console.log(Object.prototype.toString.call(function () {
}))
console.log(typeof null)
console.log(typeof undefined)
console.log(isNaN(NaN))
console.log(Number.isNaN(NaN))
try {
if (new Date() instanceof Date) {
throw new Error("try catch测试")
}
} catch (e) {
console.log(e)
console.warn(e)
console.error(e)
}
function Person(a, b, c) {
//打印Arguments对象
console.log(arguments)
}
Person(1, 2, 3)
//打印函数对象
console.dir(Person)
var jsonObj = {
name: "mengmeiqi",
age: 18
}
for (var key in jsonObj) {
console.log(key + ":" + jsonObj[key])
}
}
</script>
</body>
</html>