📜  8.1.4.数组长度或 .length - Javascript 代码示例

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

代码示例2
/*To check the length of an array, use the length property, just like
with strings. JavaScript array length is NOT fixed, meaning you can
add or remove items dynamically.*/

//Print out the length of two arrays.
let emptyArray = [];
console.log(emptyArray.length);

let programmingLanguages = ["JavaScript", "Python", "Java", "C#"];
console.log(programmingLanguages.length);

//0
//4