@zhaoyao91/bind

0.0.0 • Public • Published

Bind

Bind a child function to its parent.

Installation

npm i @zhaoyao91/bind

Usage

const bind = require("@zhaoyao91/bind");

function add(b, c) {
  return this.a + b + c;
}

const obj = {
  a: 1,
  sum: add
};

const result = bind(obj, "sum", 2)(3);
// result === 6

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @zhaoyao91/bind

Weekly Downloads

0

Version

0.0.0

License

MIT

Unpacked Size

1.14 kB

Total Files

4

Last publish

Collaborators

  • zhaoyao91