Artwork

Content provided by LearnCode.academy. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by LearnCode.academy or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

Modular Javascript - Prototypal Pattern vs Classical OOP in JS

9:29
 
Share
 

Archived series ("HTTP Redirect" status)

When? This feed was archived on October 25, 2017 00:33 (8y ago). Last successful fetch was on October 21, 2017 06:17 (8y ago)

Why? HTTP Redirect status. The feed permanently redirected to another series.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 189930353 series 181450
Content provided by LearnCode.academy. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by LearnCode.academy or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
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: https://www.youtube.com/watch?v=sWOXYDBbz0g View the whole modular JS playlist here: https://www.youtube.com/playlist?list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f SOURCE CODE HERE: http://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.
  continue reading

83 episodes

Artwork
iconShare
 

Archived series ("HTTP Redirect" status)

When? This feed was archived on October 25, 2017 00:33 (8y ago). Last successful fetch was on October 21, 2017 06:17 (8y ago)

Why? HTTP Redirect status. The feed permanently redirected to another series.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 189930353 series 181450
Content provided by LearnCode.academy. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by LearnCode.academy or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
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: https://www.youtube.com/watch?v=sWOXYDBbz0g View the whole modular JS playlist here: https://www.youtube.com/playlist?list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f SOURCE CODE HERE: http://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.
  continue reading

83 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide

Copyright 2025 | Privacy Policy | Terms of Service | | Copyright
Listen to this show while you explore
Play