loading...

re: Make Your Code Cleaner, Shorter and Easier to Read! ES6 Tips and Tricks. VIEW POST

FULL DISCUSSION
 

Nice article, nicely summary of ES6 Tips and Tricks. The for has a typo.

for (var i = 1, i < 5, i++){ // for is separated with ; instead of ,
    setTimeout(() => { console.log(i); }, 1000);
}

Correct one:

for (var i = 1; i < 5; i++){
    setTimeout(() => { console.log(i); }, 1000);
}
 

Thanks, I must have been on auto pilot!

code of conduct - report abuse