call bind or apply

JavaScript functions have three methods for controlling what "this" refers to inside them: call, apply, and bind. Call and apply both invoke a function immediately with a specified "this" value, differing only in how extra arguments are passed (individually for call, as an array for apply). Bind does not invoke the function at all but returns a new function with "this" permanently locked to the…