Function.prototype.bind returns a new function that, when called, has its this set to the provided value, with any arguments partially applied. A polyfill must handle new calls and chaining.
Under the hood, bind creates a closure that stores the original function (fn), the thisArg, and any pre-applied arguments (boundArgs). When the bound function is called, it uses apply to invoke the original function with the combined arguments. The polyfill must also handle the case where the bound function is used as a constructor with new, in which case the original this (the new object) should be preserved rather than the bound thisArg.