Definition: OOP is a programming paradigm where we organize code using objects โ bundles of data (properties) and behavior (methods).
Benefits in JavaScript:
Definition: Special function used with new keyword to create objects.
Syntax:
Definition: Objects created from a constructor inherit methods from its prototype.
Syntax:
Definition: ES6 class syntax is a cleaner way to write constructor functions & prototypes. extends allows inheritance.
Syntax:
Definition: Refers to the current object executing the function. Context matters.
Syntax:
this = โmyselfโ โ depends on who is speaking.
Definition: Catch runtime errors to prevent crashes.
Syntax:
Definition: Create custom errors when needed.
Syntax: