add tag
I am learning JavaScript and am working my way through [this]( tutorial. I am wondering if this statement is, in fact, correct:
>Arrays in JavaScript are sparse.

The following code produces `5`, instead of `1` as I would have expected, if the array was really sparse:
const a = [1];
a[5] = 1;
Top Answer
The `length` method returns the highest index in the array plus 1. It doesn't actually care how many items there are.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.