From the docs:
Lists are ordered indexed dense collections, much like a JavaScript Array.
What does "dense" mean?
From the docs:
Lists are ordered indexed dense collections, much like a JavaScript Array.
What does "dense" mean?
An object with indices from 0 to N, where every index in the range is defined, is dense.
On the other hand, an object with (e.g.) only indices 1, 100, 200, 400, 450, 500 populated is sparse, since not every index is used.
It refers to the opposite of sparse arrays. In a dense array, there exists a property with a value for every index between 0
and arr.length
.