### Install setprototypeof via npm Source: https://github.com/wesleytodd/setprototypeof/blob/master/README.md Use this command to install the package as a dependency in your project. ```bash $ npm install --save setprototypeof ``` -------------------------------- ### Use setprototypeof in JavaScript Source: https://github.com/wesleytodd/setprototypeof/blob/master/README.md Import the module and use it to set the prototype of an object, allowing access to methods defined on the prototype. ```javascript var setPrototypeOf = require('setprototypeof') var obj = {} setPrototypeOf(obj, { foo: function () { return 'bar' } }) obj.foo() // bar ``` -------------------------------- ### Import setprototypeof in TypeScript Source: https://github.com/wesleytodd/setprototypeof/blob/master/README.md The package includes support for TypeScript imports. ```typescript import setPrototypeOf from 'setprototypeof' ``` -------------------------------- ### setPrototypeOf(obj, proto) Source: https://github.com/wesleytodd/setprototypeof/blob/master/README.md Sets the prototype of a specified object to another object or null. ```APIDOC ## setPrototypeOf(obj, proto) ### Description Sets the prototype of an instantiated object to the provided prototype object. ### Parameters - **obj** (Object) - Required - The object which is to have its prototype set. - **proto** (Object|null) - Required - The object's new prototype (an object or null). ### Usage Example ```javascript var setPrototypeOf = require('setprototypeof'); var obj = {}; setPrototypeOf(obj, { foo: function () { return 'bar'; } }); obj.foo(); // returns 'bar' ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.