Limengbo 891268f387 前端项目搭建 | před 5 roky | |
---|---|---|
.. | ||
LICENSE | před 5 roky | |
README.md | před 5 roky | |
index.d.ts | před 5 roky | |
index.js | před 5 roky | |
package.json | před 5 roky |
Object.setPrototypeOf
A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8.
$ npm install --save setprototypeof
var setPrototypeOf = require('setprototypeof');
var obj = {};
setPrototypeOf(obj, {
foo: function() {
return 'bar';
}
});
obj.foo(); // bar
TypeScript is also supported:
import setPrototypeOf = require('setprototypeof');