数据类型的转换-隐式转换结论

1.数字+字符串:将数字转换为字符串。

2.数字+Boolean:将Boolean转换为number类型。

3.数字+undefined:结果为NaN,NaN的类型为number。

4.字符串+Boolean:将Boolean转换为字符串。

5.Boolean+Boolean都转换成number再相加运算。

注:NaN:not a number 判断一个非数 ,如果不是一个数字返回true,如果是一个数字返回false。

例:var  str="hello Word";

var  str1=isNaN(str);

console.log(str1);

最终结果为true。

你可能感兴趣的:(数据类型的转换-隐式转换结论)