变量的命名规则
1、变量不能以数字开头
2、不能包含运算符
null,undefined
var a
没有赋值就是undefined
var b = null
null就是空,不占空间(内存中的垃圾回收机制会定时清理null的空间,但不是立即清理,会有一定的延迟)
特殊字符与数字比较
1、==运算中null的特殊情况
null在==运算中,不会转换成number,它不等于任何值
null转换为数字型是0,但是null与任何数字进行比较都是false
null == undefined //true
undefined转换为数字型是NaN
console.log(Boolean(null));
console.log(null==0);
console.log(null==false);
console.log(Number(null));
console.log(Number(undefined));