Skip to content
Advertisement

pushing string[array] instead of ‘string’ to array in plain javascript

I have this code

JavaScript

that returns an array that contains strings like

JavaScript

And I would like to make all of the array indexes arrays themselves, so I can later push data in the array’s indexes, like

JavaScript

Does somebody know how to do this in plain javascript ?

Advertisement

Answer

If i understood well, seems you need something like this

JavaScript
JavaScript

tip: Array keys can be only indexes

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement