$rowCount = 40 ;
for (var $j = 0; $j < $rowCount -1; $j++) {
var currentNum = #something
}
I need to have a mechanism, where I can loop in a way that I will be applying the values to the currentNum
in a random way.
Eg: At the end of the loop, the currentNum
should have the value (0....39)
. But it shouldn't be applied starting from 0,1,2,3,4,5,6,7,8,.....39
.
It should be applied in a random way like 39, 4, 5,17, 28 , 16 ....
and it should cover all the numbers from 0-40
. I figured this can be achieved using a HashMap
in java, but how to implement in javascript?