js经典面试题

一、使用 typeof bar === "object" 判断 bar 是否是一个对象有神马潜在的弊端?如何避免这种弊端?编程 使用 typeof 的弊端是显而易见的(这种弊端同使用 instanceof):数组 ? 1 2 3 4 5 6 let obj = {}; let arr = [];   console.log( typeof obj === 'object' ); //true co
相关文章
相关标签/搜索