문제

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.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 softwareengineering.stackexchange
scroll top