Question

I am reading "Javascript : The good Parts" to improve my Javascript bases and knowledge. I was reading stuff about prototype and I encountered in this function :

var stooge = { ... } 
if(typeof Object.create !== 'function'){
   Object.create = function(o) {
   var F = function () {};
   F.prototype = o;
   return new F();
   };
}
var another_stooge = Object.create(stooge);

I didn't really get the meaning and the benefit of creating this function.

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top