1、加法+运算符:
1.1、字符串类型与任何类型相加 符号“+”做链接作用
1.2、数字类型与数字类型、null(nulld在这里隐式转换为数字类型为0)相加 符号“+”做加法作用
1.3、数字类型 null 与Undefined相加 结果为NaN

2、减-运算符:
2.1、所有类型减(除Undefined之外)的所有类型 符号“-”做减法作用
2.2、Undefined减(不包括字符串类型)的所有数据类型的都为NaN

3、乘法运算符:
3.1、所有类型乘(除Undefined之外)的所有类型 符号“*”做乘法作用(null与所有类型相乘,结果为0)
3.2、Undefined乘所有数据类型的都为NaN

4、除法运算符:
4.1、字符串类型 数字类型与 null 相除 结果为 Infinity
4.2、字符串类型、数字类型 null与 Undefined 相除 结果为 NaN
4.3、字符串类型 数字类型 null与 字符串类型、数字类型 null相除 符号“/” 做除法作用

5、取余%运算符:
5.1、Undefined 与所有数据类型的 取余 都为NaN
5.2、字符串类型、数字类型与null取余 结果为NaN
5.3、字符串类型与 字符串类型、数字类型取余 符号“%”做取余作用

网友评论