Piece of code (usually JavaScript on the Web) used to provide modern functionality on older browsers that do not natively support it.
Native implementations of APIs can do more and are faster than polyfills
// Assuming we want to use a log API log("this API doesn't exist right now, but will in future") // Above will avaluate to `uncaught ReferenceError: log is not defined` // Patching (creating polyfill) to make API available if (!window.log) { console.log("...patching); // define function on the fly window.log = msg => console.log(msg); }