Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14
Chapter 7

What is Object-Oriented Programming?

The OOP paradigm and its four pillars.


What is Object-Oriented Programming?

A programming paradigm based on objects and classes. OOP organises software around data (objects) rather than functions and logic. In JavaScript, classes provide a clean syntax to define objects with shared behaviour.

PillarMeaning
EncapsulationBundle data and methods into a single class unit.
InheritanceChild classes extend parent class properties/methods.
PolymorphismSame interface, different behaviour per object type.
AbstractionHide complexity; expose only what is necessary.

Activity — complete the code

Complete the code correctly to mark this lesson as complete automatically.

Name the four pillars of object-oriented programming.

// OOP pillars
// : bundle data and methods into one unit
// : child classes extend parent classes
// : same interface, different behaviour
// : hide complexity, expose only what is needed