JS Coding Questions Logo
JS Coding Questions
#399💼 Interview

What is the difference between shim and polyfill

Advertisement

728x90

A shim is a library that brings a new API to an older environment, using only the means of that environment. It isn't necessarily restricted to a web application. For example, es5-shim.js is used to emulate ES5 features on older browsers (mainly pre IE9).

Whereas polyfill is a piece of code (or plugin) that provides the technology that you, the developer, expect the browser to provide natively.

In a simple sentence, a polyfill is a shim for a browser API.

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 56

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
399of476