Collection: A computer programming term for a list of items. An array is just one kind of collection
It's the other way around: Lists are a type of Collection. There's also collections that aren't lists, like sets or maps, but all lists are collections.
The index of an element in an array is its numerical position.
In that case, the first element would have the index 1. In JS, the index isn't the numerical position but the offset from the first element.
Two minor vocabulary nitpicks:
It's the other way around: Lists are a type of Collection. There's also collections that aren't lists, like sets or maps, but all lists are collections.
In that case, the first element would have the index
1
. In JS, the index isn't the numerical position but the offset from the first element.Thanks for the info!