JavaScript: Classes, Objects, Constructor, Methods and Properties

Опубликовано: 07 October 2024
на канале: JavaScript Academy
1,016
29

Concepts Covered: Classes, Objects, Constructors, Methods and Properties

Classes are a template for creating objects.
An object is an instance of a class.
Class has attributes and methods.
Attribute/Properties define the characteristics of an object. Examples: Name, Size, Color etc.
A method is an action/function that can be performed.
A class contains a special method called constructor which is used for creating and initializing an object created with a class.
There can be only one constructor in each class.