JavaScript has three different methods that allow you to change the value of this for a given function.
Those methods are Function.prototype.call(), Function.prototype.apply() and Function.prototype.bind().
-
call invokes the function and allows you to pass in arguments one by one.
-
apply invokes the function and allows you to pass in arguments as an array.
-
bind returns a new function, allowing you to pass in a this array and any number of arguments.