Polyfills and Transpilers in JavaScript

1. Transpilers

2. Polyfills

if (!Math.trunc) { // if no such function
// implement it
Math.trunc = function(number) {
// Math.ceil and Math.floor exist even in ancient JavaScript engines
// they are covered later in the tutorial
return number < 0 ? Math.ceil(number) : Math.floor(number);
};
}

--

--

--

Developer with 3 yrs of industrial experience in developing scalable web applications.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Short Shortnner, the open source URL Shortener of the future.

Daily Hack in JavaScript find Index and Value of an object | Day-1

Render Props Pattern

Javascript just-in-time Compilation

Using TypeScript discriminated union pattern to control required props in React

Javascript 考題 (2)

Social login with React Native

Using nodemon for auto-reload of server after code change for node.js applications

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhay Jain

Abhay Jain

Developer with 3 yrs of industrial experience in developing scalable web applications.

More from Medium

JavaScript Primitives vs Reference Types

Destructuring Arrays in JavaScript

Special Concepts about JavaScript & MongoDB

How To Code an Incremental button using Vanilla JavaScript