[Learn Code]Modular Javascript - Prototypal Pattern vs Classical OOP in JS

preview_player
Показать описание
[Learn Code]Modular Javascript - Prototypal Pattern vs Classical OOP in JS.
While many JS devs still use classical OOP, many have switched to the prototypal pattern for Module Inheritance and Instantiation. Here's the prototypal pattern for JS and why some devs find it simpler to use.

View Classical Inheritance here:

View the whole modular JS playlist here:

var parent = {some: method};
//now add new methods to the child

So there's really no difference between inheritance and instantiation in the prototypal method. To create multiple children, simply:

And there you have it! Also see the source javascript code on how to include a create method so creating is a little more seamless.SUBSCRIBE for more!
Рекомендации по теме
join shbcf.ru