JavaScript Classes

preview_player
Показать описание
#javascript #javascriptclasses
Hello there! The topic is classes.
This is a tutorial about how we declare classes.
First we use class keyword then we write name of the class.
Always use upper camel case for class names.
A constructor is called when an object generated from a class.
We can use a class as a template to make an object.
Classes are templates for generating objects.

What is "this" keyword refers to in classes?
if you declare an object named tesla "this" keyword refers to tesla.
If you declare an object named honda "this" keyword refers to honda.

You can see all these topics that I mentioned in the video.
Рекомендации по теме
Комментарии
Автор

Upper camel case is also called Pascal Case

JoshuaLawrence
Автор

In reality this has no value until you are able to map such objects to a Database so that they persist and be able to run complex queries and perform CRUD operation efficiently and effectively. In all other cases it's just really cool, nothing much!

Imagine you are dealing with hundreds of thousands of such objects, this is what you need to provide such a solution for.

TarekFaham
Автор

hi bro simple explanation, nice but in constructor in which sistuation we need to use super() key word ??? bro .. plz replay

mohanj
Автор

Is it only enough to learn about the classes?.

thoufiqabdulnasar
Автор

So "this" is only needed for declaring object properties for constructors but not needed for creating NEW instances of a constructor? am i right?

rubiusoficial
Автор

bro can we use if else in class () ???

mohanj
Автор

What happens if you didn't use the new keyword? Is it a must?

Islam-and-boxing