JavaScript Classes #1: The Basics - JavaScript OOP Tutorial

preview_player
Показать описание
In JavaScript you can use the OOP (Object-Oriented-Programming) feature of "classes" to construct objects which are then useful resources for your script/application.

By using the "class" keyword you are able to create a definition of a class and then from there you can instantiate it using the "new" keyword followed by the class name. You can think of a class as being a specified structure of what the eventual object HAS and also what it DOES.

In this video I take you through a simple and easy to understand example of defining a class called "Rectangle" and then creating different objects based off of it. I explain how instance properties/variables, instance methods and how constructors work - along with the "this" keyword.

For your reference, check this out:

Support me on Patreon:

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Рекомендации по теме
Комментарии
Автор

Such an elegant & beautiful explaination! This gives me great confidence to learn code at an elder age where doubt and imposter sucks. Thanks mate :)

abhinavkumar
Автор

thank you dom im currently taking the FCC basic javascript cert and i was quite lost at ES6 but after watching this video i feel like now i understand a little bit more, your explanations are beautiful because you carry us since the beginning.

HuertaGer
Автор

Absolutely well explained!!! Thank you!

aam
Автор

What a great explanation! You’re a lifesaver thank you so much

llarn.i
Автор

Very good explanation! Thank you for that!

Kay_Drechsler
Автор

Thank you for this. I am going through a QA course currently and just had classes thrown in my face... didn't know what to do with it so I Googled and found you.

viktoriaj.
Автор

Sir you are just AWESOME. Thanks for making these videos.

jake-hezt
Автор

This channel is gold. Thank you very much, sir!

JeffRAX
Автор

that is a really clear explanation. Thank you!

HarveySpecter
Автор

Why your subcribers a few ! you really good teacher with understanding ! go ahead bro.

farmgatebd
Автор

Best explanation of classes have come across!

mulumbaandrew
Автор

Very nice explanation! Easy to follow.👏👏

rajeevthapa
Автор

One more subscriber here! You are an awesome tutor, thank you! :)

martinchakarov
Автор

Thankyou for the great tutorial. How do I append the rectangle to the document.

SarahStarmer
Автор

Hey thanks for the tutorial, i subscribed your channel🔥

SACHIN-gdzy
Автор

thanks for the simplifying the explanation and demonstration. would you be able to share how the classes use in real world?

jayteecollins
Автор

Hey, nice tutoprial.
Aren't you using JQuery when you use "${this.width}". If not could you explain that a little or point me in the right direction?
Thank you.

Ineffable_Wisdom
Автор

Thank you very much... I understand now😭😭😭

timothyletsoko
Автор

= () => {
currentWords += 'SOuu' ;
}, 5000);

Shubham-xhnz