Modular Javascript - Prototypal Pattern vs Classical OOP in JS @learncodeacademy
Modular Javascript - Prototypal Pattern vs Classical OOP in JS  @learncodeacademy
Uploaded September 2015 | Updated September 2026, 1 week ago
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:
youtube.com/watch?v=sWOXYDBbz0g

View the whole modular JS playlist here:
youtube.com/playlist?list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f

SOURCE CODE HERE: codepen.io/anon/pen/gaggvG?editors=001

Basically, when coding JS OOP with the prototypal pattern, everything is an object. You start with an object literal and, then, to inherit from it, you use Object.create(someModule) to create a child that inherits from it.

var parent = {some: method};
var child = Object.create(parent);
//now add new methods to the child
child.newMethod = someMethod;

So there's really no difference between inheritance and instantiation in the prototypal method. To create multiple children, simply:
var child1 = Object.create(parent);
var child2 = Object.create(parent);

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.

-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
youtube.com/watch?v=fgOO9YUFlGI
-~-~~-~~~-~~-~-
Modular Javascript - Prototypal Pattern vs Classical OOP in JSHow the Internet Works for Developers - Pt 1 - Overview & FrontendJavascript Events Tutorial - How Web Developers Respond to User InputjQuery Ajax Tutorial #1 - Using AJAX & APIs (jQuery Tutorial #7)Javascript Tutorial For Beginners - Free JS Course - Web Development TutorialREACT JS TUTORIAL #2 - Reactjs Components & RenderingResponsive Design Tutorial - Tips for making web sites look great on any deviceJavascript Context Tutorial - What makes Javascript Weird...and Awesome Pt5Multiple Reducers with Redux Reducers - Redux React Tutorial #4Web Development Tutorial for Beginners (#2) - Basic CSS - How to build a website with HTML & CSSYEOMAN TUTORIAL - Master Front-End Workflow with Yeoman, Grunt and BowerRapid E-Commerce with Angular and Moltin - Easy, Fast E-Commerce Development
LearnCode.academy |

Modular Javascript - Prototypal Pattern vs Classical OOP in JS

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER