In JavaScript I am filling array elements by traditional way, such as:
myArray[12] = 123;
myArray[13] = 432;
myArray[14] = 233;
myArray[15] = 98;
Is it possible to do this faster by one command?
For example to put numbers [123, 432, 233, 98] to myArray[12-15] ... somehow? Not one by one.
And how can be optimized this kind of scenario:
newArray[12] = oldArray[30];
newArray[13] = oldArray[31];
newArray[14] = oldArray[32];
newArray[15] = oldArray[33];
when n elements (4 in the above example) next each to other from one array need to be moved to another array?
Please advice.