1, 在javascript中,判断如下等式是否成立: a) “0” == 0; b) “a” == 65; c) “” == null; d) A==undefined; e) NaN==NaN; f) Null==undefined;
时间: 2023-04-06 13:00:26 浏览: 70
a) 成立,因为在比较时会将字符串“0”转换为数字0。
b) 不成立,因为在比较时会将字符串“a”转换为NaN。
c) 不成立,因为“”表示空字符串,不同于null。
d) 不成立,因为A未定义,会抛出ReferenceError错误。
e) 不成立,因为NaN与任何值都不相等,包括自身。
f) 成立,因为在比较时会将null和undefined都转换为相同的值。
相关问题
使用javascript判断如下等式是否成立: a) “0” == 0; b) “a” == 65; c) “” == null; d) A==undefined; e) NaN==NaN; f) Null==undefined;
a) 成立,因为在比较时会将字符串"0"转换为数字0。
b) 不成立,因为字符"a"的ASCII码为97,不等于数字65。
c) 不成立,因为""表示空字符串,不等于null。
d) 不成立,因为A未定义,不是undefined。
e) 不成立,因为NaN与任何值都不相等,包括它本身。
f) 成立,因为null和undefined在比较时会被转换为相等的值。
1, 在javascript中写出源码,判断如下等式是否成立: a) “0” == 0; b) “a” == 65; c) “” == null; d) A==undefined; e) NaN==NaN; f) Null==undefined;
a) 成立,因为在比较时会将字符串“0”转换为数字0。
b) 不成立,因为字符“a”的ASCII码为97,不等于数字65。
c) 不成立,因为空字符串不等于null。
d) 不成立,因为A未定义,无法比较。
e) 不成立,因为NaN与任何值都不相等,包括自身。
f) 成立,因为在比较时会将null和undefined都转换为相同的值,即它们相等。