0
I’m trying to run the following code, only I can’t! It’s like the browser stops working.
var scores = [60, 50, 60, 58, 54, 54,
58, 50, 52, 54, 48, 69,
34, 55, 51, 52, 44, 51,
69, 64, 66, 55, 52, 61,
46, 31, 57, 52, 44, 18,
41, 53, 55, 61, 51, 44];
for (var i=0; i < scores.length; i = i++) {
console.log("Buble Solution #" + i + " Score: " + scores[i]);
}
But when I try to perform the synonym with the i = i + 1
, works!
Very good! Thank you! Helped me a lot!
– Rodolpho Bravo
or
++i
which increments the variable and then returns the new value. I still believe that in your situation, useforEach
would be more performatic..– Ilario Junior