Perhaps just passing them as such parameters ?:
function colRowScan(1stAxis,2ndAxis) for 1.. 1stAxis for 1.. 2ndAxis do something with ary[x][y]
Not seeing what βsomethingβ is doing, I donβt know if there are unforeseen reasons why this may not work, but considering what you posted, this should do the trick.
I'm not quite sure what you are trying to do here:
let numPx = width * height; for (let px = 0; px < numPx; px++) { let [x, y] = yAxis ? [px % width, 0 | px / width] : [0 | px / height, px % height];
source share