What is Object-Oriented Programming?
Understand the core concepts of object-oriented programming as a programming style that organizes software design around objects and their properties. Learn how objects communicate and how this approach applies in JavaScript, including improvements introduced in ES6. This lesson sets the foundation for writing modular, maintainable code using OOP principles.
We'll cover the following...
Introduction
If you are familiar with languages such as C# and Java, then you must have heard the term Object-Oriented Programming (OOP). You might have an idea of OOP and how it relates to classes and objects. Before we delve into those details, let’s take a look at the definition.
Definition
Object-oriented programming is a style of programming, not a tool, which is why despite being old, it’s very popular and widely used. This style involves breaking a program into segments of objects that can communicate with each other. Each object is defined by its own set of properties. These properties can then be accessed and modified through various operations.
Example
Explanation
The above illustration gives a real-life example of an employee record in which each employee can be considered an “object”. Since every employee has a name, age, and designation, these can be considered the properties of that employee.