3 ms·
I don't do much serious JS. What's the problem there?
by imh 10y ago
I don't do much serious JS. What's the problem there?
- dustinswan 10y agoThe first one returns an object, the second one returns undefined
- k__ 10y agoJavaScript 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]