chdyiboke / weekly

issue and share weekly
5 stars 1 forks source link

隐式转换 #53

Open chdyiboke opened 3 years ago

chdyiboke commented 3 years ago

4种法则: 数据类型不一样 == 判断时转换。

  1. 对象 == 字符串 (对象 tostring ==字符串 tostring)
  2. null == undefined 和其他值比较不再相等
  3. NAN任何都不相等
  4. 剩下都转换为数字