Array Length
noun
say it: “uh-RAY LENGKTH” /əˈreɪ lɛŋkθ/
How many items a JavaScript array holds right now. It goes up when you add items and down when you remove them, and you read it with .length.
What is Array Length in JavaScript?
Array Length — The fixed number of elements an array can hold.
const stops = ["Oak", "Pine", "Lake"];
const secondStop = stops[1];
const stopCount = stops.length;
In a sentence
- “The cart page shows the length of the cart list next to the basket icon.”
- “After I added two songs, the playlist's length went from 2 to 4.”
Level: Apprentice · More JavaScript terms at this level
Updated