<!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(Array.isArray({a: 1})) console.log(typeof null) console.log(typeof a) console.log(isNaN(1 / 0 * 0)) 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>