今天神经病又犯了,突发奇想的试试看对一些基本数值类型应用运算,会出现啥现象。
先列出来一些类型的数值
let obj = {a:1,b:2};
obj+null; //[object Object]null
obj+undefined; //[object Object]undefined
let num = 123;
num+null; //123
num+undefined; //NaN
let str = 'aaa';
str+null; //'aaanull'
str+undefined; //"aaaundefined"
let str2 = '123';
function fn(){}
let arr = [1,2,3];
let n = null;
let u = undefined;
let t = true;
let f = false;
网友评论