📜  数组也是 JavaScript 代码示例中的对象

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