Babel in 30 seconds

Most of the browsers understand ES5 which is the version of javascript, with new developments in javascript we use arrow functions and other syntaxes which modern browsers have difficulty in understanding.

To make different browsers understand ES6, ES7 and other versions, we use Babel.

Babel is a javascript compiler that takes ES6 and other versions code and convert it to ES5.

If you are using React, and wonder why you need Babel with React, it’s because in React we use something called JSX, which is short for javascript xml.

Browsers no nothing about JSX, to convert JSX to native javascript we use Babel with React.

As an example, if you write this in your React app:

jsx code

It will be converted to

compiled code of jsx by Babel

That was Babel in 30 seconds and my Day 3/100 of learning React framework

See you in next chapter!

--

--

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