📌  相关文章
📜  是数组也是一个对象 javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:00.348000             🧑  作者: Mango

代码示例1
// Prove that Array is also an Object in JavaScript
// Method -1
let arr = [];
console.log(typeof arr);

// Method -2
let arr2 = [];
if (Array.isArray(arr2)) {
   console.log(`Array is an Object in JavaScript`);
}