Polymorphism
Definition
The ability for different classes to respond to the same method call in different ways. In JavaScript, polymorphism is achieved through method overriding in subclasses and duck typing.
Code Example
Learn More
Related Terms
ES6 syntactic sugar over JavaScript's prototype-based inheritance. Classes provide a cleaner way to create objects and implement inheritance using extends and super.
InheritanceA mechanism where a class (child) derives properties and methods from another class (parent). In JavaScript, inheritance is achieved through the prototype chain or the extends keyword with ES6 classes.
EncapsulationThe practice of bundling data and methods that operate on that data within a single unit, while restricting direct access to some of the object's internals. JavaScript uses closures and private class fields (#) for encapsulation.