add tag
Bombus11
I am learning JavaScript and am working my way through [this](https://www.learn-js.org/en/Arrays) 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;
a.pop();
console.log(a.length);
```
[jsfiddle](https://jsfiddle.net/wfuhpsk0/)
Top Answer
xigoi
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.