V
V
vetsmen2017-02-11 15:25:30
JavaScript
vetsmen, 2017-02-11 15:25:30

Why does IE throw an error in function parameters and when creating an object?

There are 2 moments in the code that IE swears at.
First:
var fn = function(a, b = 50) {};
And second:

var a = 5, b = 3;
var data = {a, b};

In the first case, it waits for ')' right after the variable b, in the second case it complains about the comma after the 'a' object.
Why is this happening and how then to be in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Luzanov, 2017-02-11
@vetsmen

This is the syntactic sugar of es6 and here is its support:
https://kangax.github.io/compat-table/es6/
"how then to be in this case?"
https://babeljs.io

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question