bradleykronson
8/19/2013 - 1:55 PM

Constructor Pattern

Constructor Pattern

function Class(param1, param2) {
    this.var1 = param1;
    this.var2 = param2;
    this.method = function() {
        alert(param1 + "/" + param2);
    };
};
 
var instance = new Class("value1", "value2");