📌  相关文章
📜  javascript 将字段添加到数组 - Javascript 代码示例

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

代码示例1
//you can add custom properties to the JS arrays
  //length won't change
  
  const arr = [ 1, 2, 3, 4 ];
  arr.greeting = 'Hello, world!';

  console.log(arr.length); // 4
  console.log(arr.greeting); // Hello, world!