JavaScript OO Tests
Which's the best way to work with an object-oriented JavaScript?
JavaScript
function WayA() {
this.prop = 0;
this.method = function(){
this.prop;
}
}
var WayB = function(){
this.prop = 0;
this.method = function(){
this.prop;
}
}
dsdsdsd
var WayC = (function(){
// with encapsulation, more OO faithful
return function() {
this.prop = 0;
this.method = function(){
this.prop;
}
}
});