Umama-at-Bluchip/Quick-UI
0
1# call-bind <sup>[![Version Badge][npm-version-svg]][package-url]</sup>2 3[![github actions][actions-image]][actions-url]4[![coverage][codecov-image]][codecov-url]5[![dependency status][deps-svg]][deps-url]6[![dev dependency status][dev-deps-svg]][dev-deps-url]7[![License][license-image]][license-url]8[![Downloads][downloads-image]][downloads-url]9 10[![npm badge][npm-badge-png]][package-url]11 12Robustly `.call.bind()` a function.13 14## Getting started15 16```sh17npm install --save call-bind18```19 20## Usage/Examples21 22```js23const assert = require('assert');24const callBind = require('call-bind');25const callBound = require('call-bind/callBound');26 27function f(a, b) {28 assert.equal(this, 1);29 assert.equal(a, 2);30 assert.equal(b, 3);31 assert.equal(arguments.length, 2);32}33 34const fBound = callBind(f);35 36const slice = callBound('Array.prototype.slice');37 38delete Function.prototype.call;39delete Function.prototype.bind;40 41fBound(1, 2, 3);42 43assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);44```45 46## Tests47 48Clone the repo, `npm install`, and run `npm test`49 50[package-url]: https://npmjs.org/package/call-bind51[npm-version-svg]: https://versionbadg.es/ljharb/call-bind.svg52[deps-svg]: https://david-dm.org/ljharb/call-bind.svg53[deps-url]: https://david-dm.org/ljharb/call-bind54[dev-deps-svg]: https://david-dm.org/ljharb/call-bind/dev-status.svg55[dev-deps-url]: https://david-dm.org/ljharb/call-bind#info=devDependencies56[npm-badge-png]: https://nodei.co/npm/call-bind.png?downloads=true&stars=true57[license-image]: https://img.shields.io/npm/l/call-bind.svg58[license-url]: LICENSE59[downloads-image]: https://img.shields.io/npm/dm/call-bind.svg60[downloads-url]: https://npm-stat.com/charts.html?package=call-bind61[codecov-image]: https://codecov.io/gh/ljharb/call-bind/branch/main/graphs/badge.svg62[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind/63[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind64[actions-url]: https://github.com/ljharb/call-bind/actions65 