I wanted to manipulate/change the value of every nth value of all arrays in a multi dimensional array without creating a function. It would be something like the below but I am unsure if I can only write a looping function to achieve this in JavaScript.
let arr1 = [[1,2,3],[2,4,6],[10,20,30]];
let arr2 = [arr1[all indexes][2]*5]
I’m not 100% sure what you’re trying to describe, but you would probably want to do this with a loop. Possibly you could do it with a map(), but that depends on what your goal is.
Yes, I think you are correct. I was trying use something similar to how Python arrays function but looks like it might be necessary to use a for-loop. Thanks!