JS also provides a way for developers to customize this, and it offers three ways.
- Function.prototype.call(thisArg, argArray)
- Function.prototype.apply(thisArg [, arg1 [, args2, ...]])
- Function.prototype.bind(thisArg [, arg1 [, args2, ...]])
Explain in detail:
https://segmentfault.com/a/1190000017747952?utm_source=tag-newest