This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术 / 问个Javascript的问题:1.Why might it be unwise to determine whether an object is - or
is not - null by comparing (assumption: with triple-equal
equality operator) the value returned by typeof operator when
used on the object to the string ‘object’?
Consider the following code example:
If(typeof myobj===’object’){
}
-outlink(outlink);
2016-10-20
{308}
(#10370919@0)
-
现学现卖。'object' 不是null独用的,不是null也会出这个结果。
-tjhong(以后再说);
2016-10-20
(#10371033@0)
-
因为 console.log( typeof null ), output 'object'
-dzhu(YII);
2017-11-8
(#11167972@0)