Closed clmay closed 6 years ago
Hey Marijn,
Founds some semicolons lurking in places I did not expect to find them. Some are legal but unnecessary and possible style violations, depending which guide you prefer.
Here:
const square = function(x) { return x * x; }; // <---
And also here:
const makeNoise = function() { console.log("Pling!"); }; // <--- const power = function(base, exponent) { let result = 1; for (let count = 0; count < exponent; count++) { result *= base; } return result; }; // <---
In fact, there are several more throughout Chapter 3; guessing they're just leftovers from sketching out the examples that were not removed yet.
These are all required by the grammar if you ignore automatic semicolon insertion, and my policy in the book is to include every semicolon.
Hey Marijn,
Founds some semicolons lurking in places I did not expect to find them. Some are legal but unnecessary and possible style violations, depending which guide you prefer.
Here:
And also here:
In fact, there are several more throughout Chapter 3; guessing they're just leftovers from sketching out the examples that were not removed yet.