create function of object prototype
https://softwareengineering.stackexchange.com/questions/197186
-
06-11-2019 - |
문제
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.
올바른 솔루션이 없습니다
제휴하지 않습니다 softwareengineering.stackexchange