New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter: Objects #18
Comments
Very didactic implementation of Why not: result[coercedKey] = value; instead: Object.defineProperty(result, coercedKey, {
value,
writable: true,
enumerable: true,
configurable: true,
}); Thanks. |
const jane = {
first: 'Jane', // data property
says(text) { // method
return `${this.first} says “${text}”`; // (A)
}, // comma as separator (optional at end)
};
assert.equal(jane.says('hello'), 'Jane says “hello”');
At the first line, a method .describe() is mentioned but never seen after that. |
@navigalia I went back and forth on this. But the simpler version is probably better. It’ll be in the next release. |
@VernonHawk Good catch! It’ll be fixed in the next release. |
25.5.1.1 Handling defaults via nullish coalescing Description mentions |
25.6.9.4 A polyfill for Object.fromEntries()
|
28.5.6 states: This follows discussion of how property keys can be either strings or symbols, and either enumerable or not. So the following result was not expected:
28.5.7 is similar - Clearly I have misunderstood something, but I am not clear what I have misunderstood. |
Update: I have the 2019 print book but the 2020 ebook - the issue raised in the comment above seems to persist in 28.6.6 and 28.6.7 of the newer version. |
@wgmyers Good catch! |
|
In 28.4.5.1, |
@eeror Good point. The next release will mention this. |
pretty great chapter. I previously just care about OOP , classes, and connections btw classes. that's how OOAD and OOP works. but JS doesn't , the author talked a lot about an object. actually JS syntax makes me mad(I am programmer for many years). but reading this book is charming, very clear. appreciate it |
Hello! There it a callout about missing the deep copy functionality in JS.
Probably, this is outdated info after the structuredClone() has appeared. So I suggest to link your other post about structuredClone() instead of this warn. |
No description provided.
The text was updated successfully, but these errors were encountered: