getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
Other
177.9k stars 33.39k forks source link

Typo in Chapter 5 of this & object prototypes #1768

Closed iamsharzil closed 2 years ago

iamsharzil commented 2 years ago

Yes, I promise I've read the Contributions Guidelines (please feel free to remove this line).


Please type "I already searched for this issue":

Edition: (1st or 2nd) 1st

Book Title: this & Object Prototypes

Chapter: 5

Section Title: Setting & Shadowing Properties

Problem:

If a normal data accessor (see Chapter 3) property named foo is found anywhere higher on the [[Prototype]] chain, and it's not marked as read-only (writable:false) then a new property called foo is added directly to myObject, resulting in a shadowed property

here "writable" should be true instead of false.

getify commented 2 years ago

Please search closed issues for explanation.

iamsharzil commented 2 years ago

@getify Apologies! I should have checked the closed issues before raising one.