codemarch
codemarch

@codemarch

13 Tweets 15 reads Aug 23, 2022
JavaScript Classes.
Complete Guide:
Thread🧵
01. JavaScript class-
➡️ Classes are a template for creating objects.
02. JavaScript Class Syntax-
➡️Use the keyword class to create a class.
➡️Always add a method named constructor().
03. Creating JavaScript Class-
➡️A JavaScript class is not an object.
➡️It is a template for JavaScript objects.
04. javascript Class Methods-
➡️It is easy to define methods in the JavaScript class. You simply give the name of the method followed by (). For example,
05. Getters and Setters-
➡️In JavaScript, getter methods get the value of an object and setter methods set the value of an object.
🔹JavaScript Getter
In JavaScript, getter methods are used to access the properties of an object.
🔹JavaScript Setter
In JavaScript, setter methods are used to change the values of an object.
06. Class Inheritance-
➡️Inheritance enables you to define a class that takes all the functionality from a parent class and allows you to add more.
➡️Using class inheritance, a class can inherit all the methods and properties of another class.
07. JavaScript super() keyword-
➡️The super keyword used inside a child class denotes its parent class. For example,
08. JavaScript Static Methods-
➡️Static class methods are defined on the class itself. You cannot call a static method on an object, only on an object class.
09. Hoisting-
➡️JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the top of their scope, prior to execution of the code
10. Uses of Inheritance-
If you enjoyed reading this thread, please do the following:
1. Like the thread❤️
2. Retweet the first tweet.🔃
3. Follow me and enable notifications: ✅
@CodeMarch
Thank you for reading all the way through.

Loading suggestions...