util-lib-apply
v1.0.2
Published
Apply method of encapsulation integration
Downloads
1
Readme
util-lib-apply
Apply method of encapsulation integration
Usage
const utils = require('util-lib-apply');
function add (a, b) {
console.log('this', this);
return a + b + this.c;
}
let obj = {
c: 521,
};
window.c = 1314;
console.log(utils.apply(add, obj, [10, 20]));
console.log(utils.apply(add, null, [10, 20]));