InterviewHubPRO
Section Overview
Q405

Question 405 of 521

Part 7: Execution Context, Functional JS & V8 Engine (404 - 463)

78%
JavaScript Internals (521 Qs)•Part 7: Execution Context, Functional JS & V8 Engine (404 - 463)

What is babel

Babel is a JavaScript transpiler to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments. Some of the main features are listed below,

  1. Transform syntax
  2. Polyfill features that are missing in your target environment (using @babel/polyfill)
  3. Source code transformations (or codemods)

Practical Code Example

javascript
// Babel: JavaScript transpiler converting modern ESNext / JSX syntax into backwards-compatible ES5:
// Modern Input:
const greet = (name) => `Hello ${name}`;

// Transpiled Output:
// var greet = function(name) { return "Hello " + name; };