Support sparse arrays in JavaScript.

Don't crash when encountering [5, , 7]

Although nobody shouldn't write such code in their sane mind, it's
still valid JavaScript.

Fixes #418