Classes in JavaScript (and why syntactic sugar is fine)

Опубликовано: 06 Март 2026
на канале: In Plain English
8,750
131

Classes in JavaScript get a bad rap for many reasons. One of them is because classes are just "syntactic sugar" in JavaScript. Another is because Classes in the traditional sense do not exist in JavaScript. But does it really matter? I spend some time discussing the class keyword, what it means to be syntactic sugar, and what happens in JavaScript whenever you write a class. To understand this last bit, we also spend a bit of time looking at prototypal inheritance and how we would create objects/data structures pre ES6/ES2015.

If you found this interesting, I'd also highly recommend taking a look at @Fun Fun Function 's video on Classes in JavaScript for some additional insight:    • Class keyword - Object Creation in JavaScr...  

00:00 Preface
00:33 What is syntactic sugar?
02:05 Why do we care with regard to classes?
03:00 ES6 Classes vs ES5 Object.prototype
06:09 Closing

Accompanying GitHub repo: https://github.com/sunil-sandhu/youtu...