totally new to JS but need to use it atm.
In C language I can declare new arrays the following way: int A[10], B[A];
This way I can create custom sized arrays of a variable.
Is it possible to do the same with JavaScript? I need to make an Array with the size of a variable.
I tried to do stuff like: var n = 10; var A = new Array(n);
but it just doesn’t work.
Thanks.
Either
or
But it’s still possible to push new items.