| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=xw, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- /**
- * js基本数据类型
- * string number boolean undefined null
- *
- * 引用数据类型 Object
- * object array function
- *
- *
- * typeof判断数据类型
- * null 会判断为object
- */
- console.log(typeof(1));
- console.log(typeof("1"));
- console.log(typeof(false));
- console.log(typeof(undefined));
- console.log(typeof(null));
- var a = {
- a:"你好"
- };
- var b = [1,2,34];
- var c = function() {
- console.log("你好")
- };
- console.log(typeof(a));
- console.log(typeof(b));
- console.log(typeof(c));
- if(null == undefined) {
- console.log("你好")
- } else {
- console.log("大家好")
- }
- /**
- * = 赋值
- * == 相等 强制转换类型
- * === 全相等 类型和值必须全部相等
- */
- </script>
- </body>
- </html>
|