基本数据类型 :string boolean null undefind symbol number bigint
引用数据类型:Object(Date,Array,Function,Rexp)
这些问题你都知道吗?
console.log(true+1) // return 2
console.log("hello"+true) // return hellotrue
console.log(typeof null) // Object
console.log(undefind + 1) // return NaN
console.log(typeof NaN) // return number
console.log(typeof undefind) // return undefind
你俩到底谁是1,谁是0啊?别误会,我问的是true和false。字符串就是老大啊,和谁做运算都会转换为字符串。