You seem to be trying to fit a square peg into a star-shaped hole. Arrays in JS are actually misnamed, they are actually Lists. For game scripting you may want to make heavy use of Typed Arrays [1], which are more like the arrays you seem to be looking for.
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Type...