Sitemap
Prathameshbhalke

Prathameshbhalke

Frontend Engineer at HMX Media

Pollyfill in JavaScript🚀

2 min readJun 4, 2023

--

Hey, Developer’s Hope you all are doing well after a long since Im wrote a blog.

In the last blog we discussed some Currying in Js you can checkout the link is mentioned below.

Let’s Discuss What is Polyfill ?

Press enter or click to view image in full size

A polyfill is a piece of code (usually JavaScript on the Web) used to provide modern functionality on older browsers that do not natively support it.

Press enter or click to view image in full size

Let’ s break it down into simple understandable language,

We use the Map, filter, reduce, forEach … Etc predefined functions in JavaScript, these are the Abstract ones and reusable functions.

so many browsers do not support these Higher Order Functions:

Get Prathameshbhalke’s stories in your inbox

Join Medium for free to get updates from this writer.

There are two tools for that:
1. Transpilers.
2. Polyfills.

1. Transpilers

Transpilers are a special type of software or Algorithm to convert modern syntax code into older syntax code.

Press enter or click to view image in full size
Press enter or click to view image in full size
Transpiles it to code written into another standard Here Babel will convert it into something like this:

2. Polyfills

Polyfills are the functions that older browsers don’t support and if we don’t write some replacement functions, the code will throw a run time error.

In modern-day interviews, most companies are asking us to write polyfills for common JavaScript functionalities.

Here I will list down some important ones. The ones that are asked more frequently.

The map() and forEach:

forEach Polyfill:

Press enter or click to view image in full size

2. map() Polyfill

Press enter or click to view image in full size

Hope you like this blog please hit a like button and share with your friends

❤️You can only rise when you lift others ~~ Akshay saini

thank you🚀

https://medium.com/@prathameshbhalke125/currying-in-javascript-9be9dc23d57c

--

--