📜  js 数组长度 - Javascript 代码示例

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

代码示例6
/*
  Array Methods
  - Length
*/

// Index Start From 0 [ 0, 1, 2, 3, 4 ]

let myFriends = ["Ahmed", "Mohamed", "Sayed", "Alaa"];

myFriends.length = 2;

console.log(myFriends);