Here is an example on how to use classes and methods in Javascript:
1 2 3 4 5 6 7 8 9 10 11 12 |
function class1() { this.attribute1 = 0; this.attribute2 = 0; this.init = function() { this.attribute1 = 1; this.attribute2 = 1; } } var c = new class1(); c.init(); |





