ES6 introduced the class syntax to JavaScript. In this video I go through all the important details you need to know about classes. I will help you build the correct mental models to never use classes incorrectly.
This video is long, but it will reward you with a deep understanding of classes.
Don't hesitate to pause, take some time to absorb the content, this video is packed with a lot of information.
I put some easter eggs, will you find them?
My previous video about Objects: • Master JavaScript Objects
JavaScript playlist: • JavaScript
Cheatcheet/mindmap: https://ko-fi.com/s/34966c8fb1
Twitter: / computerbread
Subscribe: https://www.youtube.com/@ComputerBrea...
Timestamps (chapters)
00:00 Introduction
00:45 The "class" syntax
02:48 Constructor
04:53 Destructuring assignment syntax
05:14 Methods & accessors
06:13 Class.prototype
07:31 Class fields
08:45 The "static" keyword
09:59 The "this" keyword
10:48 Losing "this"
12:19 Inheritance
18:12 Override methods
20:00 Function.prototype.call() ?
20:42 The "super" keyword
21:33 How "super" works
23:05 [[HomeObject]]
24:48 "super" do's and don'ts
26:15 "super()" or Override constructor
27:30 Override fields
27:57 Fields initialization order
29:19 "extends" extra abilities
30:03 Extend built-in objects
33:53 Encapsulation
35:13 Private fields
38:28 Conclusion
#javascript #class #object #webdevelopment #100daysofcode