1.变量类型
// 值类型
var a = 100
var b = a
a = 200
console.log(b) //100
// 引用类型:对象 数组 函数
var a = {age:20}
var b = a
b.age = 21
console.log(a.age) //21
typeof
运算符,只能针对值类型,引用类型区分不出来的,函数只能识别是个function
typeof undefined // undefined
typeof 'abc' // string
typeof 123 // number
typeof true // boolean
typeof {} // object
typeof [] // object
typeof null // object
typeof console.log //function
2.变量计算-强制类型转换
// 字符串拼接,类型转换
var a = 100 + 10 // 110
var b = 100 + '10' //'10010'
// == 运算符, ===就不会出现如下问题
100 == ‘100’ //true
0 == '' //true
null == undefined //true
// if语句
// 逻辑运算符 && || !window.abc windwos.abc 是 undefined
var a = 100
console.log(!!a) //打印true false
3.js内置的函数
Object
Array
Boolean
Number
String
Function
Date
RegExp
Error
4.json
JS对象
JSON.stringify({a:10,b:20})
JSON.parse('{"a":10,"b":20}')