1 introduction - grid23/korbutJS GitHub Wiki

At the core of korbutJS, you find the class() function which emulate traditional classes in JavaScript. The class() function accepts both the old ES3 syntax, and the more recent, more complex, more configurable ES5 syntax. It offers Inheritance, Polymorphism, private/public static properties.

Understanding how class() works and what it can do for you, is the key to unlock a full comprehension of korbutJS.

similar classes defined with class(), in ES3 and ES5 syntaxes

var Foo = korbut.class({
        constructor: function(){
            console.log("a foo instance has been created") 
        })
      , bar: function(){
            console.log("method bar has been invoked")
        }
    })

var foo = new Foo() // logs: a foo instance has been created
foo.bar() // logs: method bar has been invoked
var Foo = korbut.class({
        constructor: function(){
            console.log("a foo instance has been created") 
        })
      , bar: { enumerable: true, configurable: true, writable: true,
          value: function(){
              console.log("method bar has been invoked")
          }
    })

var foo = new Foo() // logs: a foo instance has been created
foo.bar() // logs: method bar has been invoked