Monthly Archives: december 2009

icanhas javascript OOP?

In javascript we can express objects using the prototype notation:

var Cat = function () {
this.furry = true;
}
Cat.prototype.greet = function () {
return "meeow";
}

using class mimicking from prototype-js it would be :

var Cat = new Class({
initialize: function (){
[...]