Overview
Object-Oriented Programming (OOP) is a programming paradigm that creates programs while focusing on the idea of "objects" in terms of the data and code. Data are tidied in the form of fields, or better known as attributes/properties, and code, in the form of procedures (methods).
In OOP, objects are mainly created using a class template. The attributes and behaviors (methods) can be written in this class template. The objects are created when needed according to the class definition. One of the important characteristics of OOP is that the various created objects are able to work and interact with each other easily to achieve code efficiency.
To put classes and objects into an example, take the "Vehicle" as an example and see how to create a specific "Vehicle" object. The "Vehicle" class will define what general behavior and attributes a "Vehicle" will have. Based on this class, we are able to derive other classes that follow this general behavior and also create objects out of that single class.
Learning Objectives
By learning about OOP, we would be able to visualize the program and code it using the concept of objects.
By structuring the program's code in accordance with the OOP paradigm, we will be able to utilize benefits brought from it, ranging from data independence, extensibility, and reusability. These benefits allow for the ease of adding functionalities and editing of code.
For example, if we need to change the behavior of an object, we are able to make the edits without affecting other objects created using other different classes, as long as the original class was created with OOP in mind.
Learn about the concepts of OOP to write code that promotes maintainability.
Learn from Here
Here are some of the basic OOP concepts that we will need to learn when we focus on the OOP paradigm.
Understanding the Basics of OOP
Classes and Objects
Instantiate an Object from a Class
Object Properties
Object Methods and Class Methods
Inheritance
Overriding
Recommended Materials
JavaScript Study IV | Progate
You can learn about the basics of Object Orientated Programming in Study IV of the Progate ES6 Javascript course!
JavaScript Study IV | Progate
Progate is an online platform to learn programming. Learn to build your own apps and services.
progate.com
Classes in JavaScript - Learn web development | MDN
Learn about the basic theories behind OOP in programming using the resource below. It also explains how JavaScript emulates objects and classes via constructors and how to instantiate an object.
Classes in JavaScript - Learn web development | MDN
In this article, we've gone through the main tools available in JavaScript for writing object-oriented programs. We haven't covered everything here, but this should be enough to get you started. Our article on Classes is a good place to learn more.
developer.mozilla.org