關於數組的前端面試題

關於數組的前端面試題前端 一、如何判斷一個變量是否爲數組? (1)爲何不用typeof?web var list = [1,2,3]; typeof list //"object" Array繼承與Object,因此typeof 會直接返回object,因此不能夠用typeof方法來檢測 (2)爲何不用instanceof?面試 var list = [1,2,3]; list instance
相關文章
相關標籤/搜索