Recreating native browser features in plain JavaScript when the environment doesn't support them.
A polyfill is code that implements a feature manually so it works in environments that don't support it natively — recreating Array.prototype.includes, Promise, or fetch in plain JavaScript for an older browser that lacks them. Writing polyfills is also one of the most common interview formats precisely because it forces you to actually understand a feature's exact behavior, not just how to call it — you can't fake Function.prototype.bind without understanding what this binding really means.
Good polyfills go further than the happy path: implementing bind means handling being called as a constructor with new, implementing a Promise means correctly handling chained .then() calls and already-settled promises, and implementing debounce or a basic Array.prototype.map means preserving the exact edge-case behavior (sparse arrays, thisArg, the original callback signature) that the native version has. That attention to edge cases is usually what separates a polyfill that merely passes the basic example from one that would actually survive in production.
What you'll walk away knowing