You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let object = (new class { getWord() { return "hello"; } });
console.log(object.getWord());
// → hello
If I'm not mistaken, the outer parentheses aren't necessary here. If they are, maybe call attention to them. If they aren't necessary, it would seem better to leave them off as this expression would then more obviously map to how you'd write a function expression (a comparison you already make alongside the code).
P.S. Chapter 6 is pretty tough. I was warned of this chapter before I started the book, and it didn't disappoint :) I was going to submit a big issue with a few reasons why it's difficult and how it could be addressed, but I'll try to address them in individual issues.
The text was updated successfully, but these errors were encountered:
http://eloquentjavascript.net/3rd_edition/06_object.html#c_JKY9zuey2L
If I'm not mistaken, the outer parentheses aren't necessary here. If they are, maybe call attention to them. If they aren't necessary, it would seem better to leave them off as this expression would then more obviously map to how you'd write a function expression (a comparison you already make alongside the code).
P.S. Chapter 6 is pretty tough. I was warned of this chapter before I started the book, and it didn't disappoint :) I was going to submit a big issue with a few reasons why it's difficult and how it could be addressed, but I'll try to address them in individual issues.
The text was updated successfully, but these errors were encountered: