Polyfills

javascript dev.to

What are Polyfills? Polyfills are custom implementation to the common javascript methods. There can be cases where older browser is not supporting the latest javascript methods.So there we write polyfills. For Example: Polyfill for map method // Array.map using Array Method let array=[10,20,30,40,50]; let result=array.map(item=>item*2); console.log("Result",result); // Our Prototype for map Array.prototype.myMap=function(fn){ if(typeof fn !=="function"){ throw new Error("Passe

Read Full Tutorial open_in_new
arrow_back Back to Tutorials