bind
Creates a function that invokes fn
with a given context, optionally prepending any additional supplied parameters to the arguments.
- Return a
function
that usesFunction.prototype.apply()
to apply the givencontext
tofn
. - Use the spread operator (
...
) to prepend any additional supplied parameters to the arguments.