DEV Community

Cover image for OOP
Arun Mahara
Arun Mahara

Posted on

OOP

Object-oriented programming (OOP) is nothing but that which allows the writing of programs with the help of certain classes and real-time objects. It is a programming paradigm that relies on the concept of classes and objects. It is used to structure a software program into simple, reusable pieces of code blueprints (usually called classes), which are used to create individual instances of objects.
• OOP models complex things as reproducible, simple structures.
• Reusable, OOP objects can be used across programs.
• Allows for class-specific behavior through polymorphism.
• Easier to debug, classes often contain all applicable information to them.
• Secure, protects information through encapsulation.

There are certain features or mechanisms which makes a JavaScript Object-Oriented like:
Classes: A code template for creating objects.
Image description
Object: Objects are variables which can contain many values.
Image description
Encapsulation: The process of wrapping property and function within a single unit.
Image description
Inheritance: A concept in which some property and methods of an Object is being used by another Object.
Image description

Top comments (0)