Skip to content

souparno/Class.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status
NPM

a super small javascript Inheritance framework based out on John Resig blog https://johnresig.com/blog/simple-javascript-inheritance/

  var Vehicle = Class.Create({
    init: function(wheels) {
      this.wheels = wheels;
    }
  });

  var Truck = Vehicle.Extend({
    init: function(hp, wheels) {
      this._super(wheels);
      this.horsepower = hp;
    },
    printInfo: function() {
      console.log('I am a truck and I have ' + this.wheels +
        ' wheels and ' + this.horsepower + ' hp.');
    }
  });
  
  var t = new Truck(350, 4);
  t.printInfo();

About

an object oriented javascript framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published