🎶转 boolean 规则:
null, undefined, “”, 0, -0, NaN 转换成布尔值是false, 剩下的全转化 true;
🍧转 number 规则:
- string ‘2.3.1’ => NaN;
- null, ‘’, false, [] ==>> 0;
- undefined => NaN;
- object => x Number(object.toString())
✨ 隐式类型转换 ==
- 有布尔值则转换为数值
- 字符串数值,则字符串转换为数值
- 只有一个是对象,则toString() valueOf()
- null == undefined
- NaN != NaN
- 对象==,比较内存地址