Let's do some practice exercises together to get a better handle on Prototypes and Prototypal Inheritance in Javascript together.
We start with adding to the String prototype as well as looking at Object.getOwnPropertyNames to look through the prototypes of Arrays and Objects and how prototype chaining works.
We then take a look at how we can create "array-like" Objects as well as how prototypes are truly shared amongst all instances of that Object.
We wrap up with a bonus to take a look at how the "new" and "this" keywords affect prototypes and the prototype chain in Javascript.
This is part of a series where we go over Javascript in depth to learn programming concepts as well as web development: • Javascript In Depth
Chapters:
00:00 Introduction
00:28 Warmup Exercise - String Prototype
05:49 Exercise 1 - Logging Prototypes
16:18 Exercise 2 - Array-Like Object
23:52 Exercise 3 - Sharing a Prototype
36:35 BONUS Exercise - "new" and "this" keywords
47:35 Next Steps
📦 Github Repository with the notes and exercise code+solutions: https://github.com/Nooder/javascript-...
💬 Come join us on Discord to chat with a like-minded community about tech and learning: / discord
🏅Support the channel and content through Super Thanks, Channel Memberships, or on Patreon: / techwithnader