demo on inheritence

inheritence

by de Montalembert Jonathan

JavaScript

(function(){
function f(){
  function init(){
    return 1;
  }
}
var a = new f();
a.p ='inherit 1';
f.prototype.p = 'inherit 2';
console.log(a.p);
a = new f()
console.log(a.p);
})();