Grokking Advanced JavaScript
Vote

0% completed

​

Introduction to Object-Oriented Programming

A program can be organized around objects. An object keeps related data together with the functions that work on that data. The data lives in properties, and a function stored on an object is called a method. This way of building programs is called object-oriented programming, or OOP.

Here is a small object that describes one car. It holds three pieces of data and one method that reads them.

2021 Toyota Corolla

Inside describe(), the keyword this refers to the object that the method was called on, so the method can read the car's own data

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content