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

📅  最后修改于: 2022-03-11 15:03:05.600000             🧑  作者: 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`);
}