9
rated 0 times
[
13]
[
4]
/ answers: 1 / hits: 37508
/ 9 Years ago, fri, january 22, 2016, 12:00:00
I was under the impression semicolons became obsolete with ES6. However, I came across this today:
Doesn't work:
let i = 0
[0, 1, 2, 3, 4, 5, 6].forEach(item => console.log(item))
Works:
let i = 0;
[0, 1, 2, 3, 4, 5, 6].forEach(item => console.log(item))
Why is the semicolon necessary here, and when should I use them?
More From » node.js