The general idea is, code a bit and try, code a bit and try... Here's an example with an explanation about classes in JavaScript. Classes were added in last version of JavaScript (called ECMAScript 6 ...
Classy offers the ability to easily define classes, call super or overriden methods, define static properties, and mixin objects in a very flexible way. Meant to be used in the browser and in node.