What is Babel?

devquora
devquora

Posted On: Feb 22, 2018

 

Babel is one of the most popular JavaScript transpilers and becomes the industry standard. It allows us to write ES6 code and convert it back in pre-Es6 JavaScript that browser supports.

For example look the below code snippet.
In ES6 (ECMASCRIPT 2015)

const PI = 3.141593;
PI > 3.0 ;
export{PI};

In ES5 after conversion

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
var PI = 3.141593;
PI > 3.0;
exports.PI = PI;

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    ES6 Interview Questions

    What is ES6?

    Es6 or ECMASCRIPT 2015 is sixth major release of ECMAScript language which comes with a lot of new features and syntax..

    ES6 Interview Questions

    List some new features of ES6

    New Features in ES6. Support for constants (also known as “immutable variables”) Block-Scope support for both varia..

    ES6 Interview Questions

    List steps to install Babel?

    Installation: In order to install Babel, you require node.js and NPM. Make sure Node.js is installed on your server. To ..