A polyfill is code that makes it possible to use a web platform feature in a browser which does not support that feature. MDN provides a detailed description of situations in which polyfills are best used.

How to use polyfills

To use a polyfill, you import the relevant code into your project. How you do this depends on the situation.

A small fix could be applied by attaching the JS file to your page with a script tag. However, using a package manager may be easier depending on your technology stack. Some frameworks even provide polyfills automatically if needed based on your Browser Support Level Matrix.

A great resource for building packages suited to your needs is polyfill.io.