var arr = [];
arr[0] = 'a';
arr[1] = 'b';
arr.foo = 'c';
console.log(arr)
console.log(arr.length);

给数组添加属性

 

相关文章:

  • 2022-01-10
  • 2021-06-23
  • 2021-12-27
  • 2021-10-13
  • 2021-10-22
猜你喜欢
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
  • 2021-10-09
  • 2021-12-30
  • 2021-06-21
相关资源
相似解决方案