Babel is this still relevant or not?

Hello. I'm starting to learn JavaScript, I wrote code using ECMAScript 2015. In all browsers, everything worked. Do I need to use Babel now to turn the code from ES6 to ES5, or is it no longer relevant? Thanks.

Author: Anton, 2018-02-11

2 answers

In all browsers, everything worked

Well, you could not check in all browsers, there is enough time and effort. In one browser, one engine, in another, another. And no one is obliged to call any things the same. So yes, babel is still relevant, and will be for a long time, until at one point all browsers disappear and others with the same API appear in their place.

Since for one procanet this is:

function Bla(a = 1, b = 2) {}

And for the other one, you need to write something like this:

function Bla() {
  var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
  var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
}
 4
Author: Profesor08, 2018-02-11 20:25:16

The question is already a year and a half old, but I think it is necessary to supplement the answer.

Rather than manually checking the code already written in different browsers, it is much better to first go to MDN or Can I use, and check which browsers support the features and functions that you are going to use. You compare the received data with the browser support requirements of your project. And based on this, you decide whether you need babel in your project, and whether you should use it some individual" too new " features.

 0
Author: Thomas Ashcraft, 2019-10-15 08:01:19