A simple cross platform implementation to set the prototype of an instantiated object. Supports all modern browsers and at least back to IE8.
$ npm install --save setprototypeof
varsetPrototypeOf=require('setprototypeof')varobj={}setPrototypeOf(obj,{foo: function(){return'bar'}})obj.foo()// barTypeScript is also supported:
importsetPrototypeOffrom'setprototypeof'