1、字符串和数字比较
- 如果type(x)是数字,type(y)是字符串,则返回x==toNumber(y)的结果。
- 如果type(x)是字符串,type(y)是数字,则返回toNumber(x)==y的结果。
2、数字和布尔值比较
- 如果type(y)是布尔值,则返回x==toNumber(y)的结果。
- 如果type(x)是布尔值,则返回toNumber(x)==y的结果。
console.log(undefined==null) //true
console.log(undefined===null) //false