3 ms·
JavaScript has automatic semicolon insertion (ASI). This will add semicolons all over your code depending on some rules, for example, if you write a return, an
by k__ 10y ago
JavaScript has automatic semicolon insertion (ASI).
This will add semicolons all over your code depending on some rules, for example, if you write a return, and write the value you want to return in the next line, it adds a semicolon after the return AND after the value, effectively ignoring the value in the end.
return
myValue;
becomes
return;
myValue;
It's a bit meh, because you have to remember these rules even if you use semicolons.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]