判斷是否是對象

判斷是否是對象 typeof不許確web //方法一 var arr = []; var obj = new Object(); typeof obj === 'object' //true //方法二 arr instanceof Object //true arr instanceof Array //true 方法一二都不嚴謹 //方法三 var s = 'a string'; var
相關文章
相關標籤/搜索