What is Object Oriented Programming?

This lesson gives a short introduction to object-oriented programming.

We'll cover the following

Introduction

If you are familiar with other languages such as C# and Java, then you must have heard the term Object-Oriented Programming (OOP). You might have an idea of it having something to do with classes or objects. However, before we delve into those details let’s take a look at the definition of object-oriented programming.

Definition

Object-oriented programming is a style of programming, it is not a tool, which is why even though it is old it is still very popular and is 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 an example from real-life of an employee record where each employee can be considered as an “object” and since every employee has a name, age, and designation, these can be considered the properties of that employee.


Now that you know the basic concept of object-oriented programming let’s see how it is used in JavaScript and how it differs from OOP in other languages.