In Javascript, when you write a piece of code like the one below, it seems like the computer will first complete the entire loop 100 000 times (which can take a second or tw
If you want a smoother output, I would suggest avoiding the for loop, and instead use requestAnimationFrame
which will manage when to print out the results.
var counter = 0;
var max = 100000;
function myPrint(){
if(counter < max){
console.log(counter++);
requestAnimationFrame(myPrint);
}
}
myPrint();