Simple inheritance system that takes advantage of the Javascript's prototype chain
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
daClass.js

README.md

daClass

Creating a simple "class":

var Animal = daClass({
    //properties
    name: '',

    // Constructor
    init: function(name){
        this.name = name;
    },

    getName: function(){
        return this.name;
    }
});


var Bird = daClass(Animal, {
    // Constructor
    init: function(name){
        this.super(arguments);
        this.name = "Hi " + this.name ;
    }
});

var bird1 = new Bird('Pigeon');
console.log( bird1.getName() ); // Hi Pigeon