Travis build: 210

This commit is contained in:
30secondsofcode
2018-08-10 07:50:02 +00:00
parent 8e034d48ee
commit 93e9513c8b
3 changed files with 7 additions and 10 deletions

View File

@ -4467,13 +4467,11 @@ console.log(freddyBound('hi', '!')); // 'hi fred!'
Creates a function that invokes the method at a given key of an object, optionally adding any additional supplied parameters to the beginning of the arguments.
Return a `function` that uses `Function.apply()` to bind `context[fn]` to `context`.
Use `Array.concat()` to prepend any additional supplied parameters to the arguments.
Use the spread operator (`...`) to prepend any additional supplied parameters to the arguments.
```js
const bindKey = (context, fn, ...args) =>
function() {
return context[fn].apply(context, args.concat(...arguments));
};
const bindKey = (context, fn, ...boundArgs) => (...args) =>
context[fn].apply(context, [...boundArgs, ...args]);
```
<details>