variable-length array data structure in Javascript programming language