In JavaScript, a function is also an object and has a prototype, properties, methods. All functions that are used in javascript are Function objects and have all its properties and methods.
So among the methods I want to note bind() ,call () and apply ().
BIND
The someFunction.bind (someObject) method allows you to create a new function with the same body and scope as the someFunction function, but with a binding to the someObject object:
CALL
The call () method calls a function with the specified this value and arguments.
this points to the object for which the function is called — in this case, the global window object.
If the object for which the function is called is not important to us, then we can pass the value null.
APPLY
The apply () method is similar to the call () method, which also calls the function and also receives the object for which the function is called as the first parameter. Only now, an array of arguments is passed as the second parameter: