Object Inheritance | Keeping Up With the Javascripts (JS ES6)

preview_player
Показать описание
Object inheritance is a very important concept to understand in Javascript. JS objects can inherit properties from a number of sources, or their prototype. Understanding how those sources can work with each other (or conflict with each other) is crucial to your work with classes or any work with the prototype chain.

Watch the all the available previews by visiting the playlist here:

#javascript #js #es6
Рекомендации по теме
Комментарии
Автор

Instead of setting prototype using Object.create( ) and then setting constructor property explicitly we can use Object.setPrototypeOf(Dog.prototype, Animal.prototype). It will preserve all the properties of Dog.prototype. BTW Nice explanation of Prototypal Inheritance. :)

saketparasher
join shbcf.ru