Back to JavaScript

JavaScript Tutorial

Object-Oriented Programming (OOP)

Organize code with classes, objects, methods, and inheritance.

Object-Oriented Programming groups data and behavior together.

JavaScript supports OOP through objects, prototypes, and classes.

javascript
class Course {
  constructor(title) {
    this.title = title;
  }

  start() {
    console.log(this.title + " started");
  }
}