[javascript] Why doesn't JavaScript have a last method?

You can do something like this:

[10, 20, 30, 40].slice(-1)[0]

_x000D_
_x000D_
console.log([10, 20, 30, 40].slice(-1)[0])
_x000D_
_x000D_
_x000D_

The amount of helper methods that can be added to a language is infinite. I suppose they just haven't considered adding this one.