The file 1-list.js below shows how to declare a OO-style class in JavaScript.
Note that the only things assigned to properties of this
are anonymous functions. These are the "methods" of the class that access "private" properties. JavaScript doesn't have the keyword
private like some other languages. Instead, the "private data members" of a class are the local variables and parameters of the
class constructor. Most JavaScript code in the wild doesn't attempt to make anything "private" which is just bad OO design. Here, the
"methods" are functions nested inside the constructor to give them access to the constructors local variables.
Typical JavaScript code you see in the wild would have placed the methods as properties of List.prototype which allows for