123456789101112131415161718192021222324252627282930313233 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- var a = '123';
- console.log(typeof null);
- if(null===undefined) {
- console.log(1)
- }else {
- console.log(2)
- }
- // 0.1+0.2!=0.3
- /**
- * 1.typeof 类型判断
- * 2.instanceof
- * 3.Object.prototype.toString.call()
- * 4.constructor
- */
- var fn1 = function() {
- console.log("这是一个函数");
- }
- console.log(fn1 instanceof Function);
- console.log(Object.prototype.toString.call(true));
- var num = 10;
- console.log(num.constructor);
- </script>
- </body>
- </html>
|