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.