📌  相关文章
📜  创建具有 1 个值的 javascript 数组 - Javascript 代码示例

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

代码示例1
let arr = [42]       // Creates an array with only one element:
                     // the number 42.

let arr = Array(42)  // Creates an array with no elements
                     // and arr.length set to 42.
                     //
                     // This is equivalent to:
let arr = []
arr.length = 42