|
|
|
|
|
by jephir
4119 days ago
|
|
> Code defensively, and don't get fancy unless you need to. You're not just complying with the language spec, you are communicating your intent to the other developers who will read and maintain your code. Leaving out semicolons actually makes the intent more clear. People run into problems with semicolon insertion when they try to create an unnamed expression, i.e: ["joe", "bob", "ann"].forEach(call);
If you use a no-semicolon style, though, you must name all your expressions, which makes your intent more clear: var employees = ["joe", "bob", "ann"]
employees.forEach(call)
|
|
> If you use a no-semicolon style, though, you must name all your expressions.
Thanks, I guess I missed that point.