JS: “function” (keyword) call, apply, bind
The following are ways to let you call a function and explicitly pass a value of your choice for this (binding) .
- Reflect.apply
- Best. Functional programing approach.
- Function.prototype.call
- args are separate values.
- Function.prototype.apply
- args must be a array.
- Function.prototype.bind
- return a new function with a given this-binding.