yangshun / front-end-interview-handbook

⚡️ Front End interview preparation materials for busy engineers
https://frontendinterviewhandbook.com
MIT License
41.63k stars 5.78k forks source link

Explain how prototypal inheritance works #415

Open bodyazinchenko opened 7 months ago

bodyazinchenko commented 7 months ago

https://www.greatfrontend.com/questions/quiz/explain-how-prototypal-inheritance-works

In this chapter, it is described that:

Using Object.create to build the inheritance chain is no longer recommended. Use Object.setPrototypeOf instead.

But the mdn documentation says the opposite, that the preferred method for setting prototypes is Object.create() - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf

image

I suggest to change this sentence

manhphim commented 7 months ago

Same finding there. Hope to see this change soon