O'Reilly logo
  • Patrick S thinks this is interesting:

In object-oriented programming (OOP), an object is an instance of a class. A class defines the characteristics of the object. For our algorithms and data structures, we will create some classes that will represent them. This is how we can declare a class that represents a book:

function Book(title, pages, isbn){
    this.title = title;
    this.pages = pages;
    this.isbn = isbn;


Cover of Learning JavaScript Data Structures and Algorithms


define a Class represents a Book object