In theory, JavaScript does not have classes. In practice, the following snippet of code is widely considered to be an example of a “class” in JavaScript: function Account () { this._currentBalance = 0; } Account.prototype.balance = function () { return this._currentBalance; } Account.prototype.deposit = function (howMuch) { this._currentBalance = this._currentBalance + howMuch; return this; } // .