Classes in JavaScript (and why syntactic sugar is fine)

preview_player
Показать описание
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.

00:00 Preface
00:33 What is syntactic sugar?
02:05 Why do we care with regard to classes?
06:09 Closing

Рекомендации по теме
Комментарии
Автор

I came to JavaScript from C# and before that C++. It was a shock to discover that although the syntax is very similar JavaScript is profoundly different. Many people must have spent vast amounts of time trying to simulate classical OOP in JS with cumbersome workarounds so to me introducing classes was the point when JS finally grew up.
Like any other language feature, you don't have to use it but it's there if you want it.

cawsha
Автор

I really appreciated the way you exposed the subject. Congratz.

mreis
Автор

Nice video, dude. This was very helpful!

Alphaantzz
Автор

Thanks for the video! It really helps!

xinli
Автор

Really enjoying this new series so far and looking forward to the next one :) I'd love to see your take on "composition pattern". at some point. Thanks

ThierryPBeaulieu
Автор

I'd like to learn more about modules and importing/exporting. Thanks.

gbbowler
Автор

Nice tutorial man, thanks i sub, I like that u explain 1 thing properly, really diving deep

MZ-yxeg
Автор

Can you do a video about AST in JavaScript?

Niweera
Автор

Thx for this video, i've a problems for understand the methood map, reduce and filter.
Saludos desde Argentina.

juanignaciocaceres
Автор

I couldn't understand what is syntactic sugar.

srvtrydvejayesh
Автор

Developers ain't dogmatic! When someone puts enormous amount of time and energy to master something he attaches to it emotionally. So it's very natural of him to behave in an almost fanatic way! Try to understand that.

RameenFallschirmjager