Top "Ecmascript-6" questions

The 2015 version of the ECMAScript specification, now a standard (ECMAScript 2015).

Private properties in JavaScript ES6 classes

Is it possible to create private properties in ES6 classes? Here's an example. How can I prevent access to instance.…

javascript class ecmascript-6 private-members es2015
reactjs giving error Uncaught TypeError: Super expression must either be null or a function, not undefined

I am using reactjs. When I run the code below the browser says: Uncaught TypeError: Super expression must either be …

reactjs ecmascript-6
What's the meaning of "=>" (an arrow formed from equals & greater than) in JavaScript?

I know that the >= operator means more than or equal to, but I've seen => in some source code. …

javascript syntax ecmascript-6 arrow-functions
Declaring static constants in ES6 classes?

I want to implement constants in a class, because that's where it makes sense to locate them in the code. …

javascript class constants ecmascript-6
Is it possible to import modules from all files in a directory, using a wildcard?

With ES6, I can import several exports from a file like this: import {ThingA, ThingB, ThingC} from 'lib/things'; However, …

javascript ecmascript-6 es6-modules
Call async/await functions in parallel

As far as I understand, in ES7/ES2016 putting multiple await's in code will work similar to chaining .then() with …

javascript node.js asynchronous ecmascript-6 babeljs
How to set component default props on React component

I use the code below to set default props on a React component but it doesn't work. In the render() …

reactjs ecmascript-6
How can I mock an ES6 module import using Jest?

I want to test that one of my ES6 modules calls another ES6 module in a particular way. With Jasmine …

javascript node.js mocking ecmascript-6 jestjs
ES6 map an array of objects, to return an array of objects with new keys

I have an array of objects: [ { id: 1, name: 'bill' }, { id: 2, name: 'ted' } ] Looking for a simple one-liner to return: [ { value: 1, …

javascript ecmascript-6
How to implement private method in ES6 class with Traceur

I use Traceur Compiler to have advantage with ES6 features now. I want to implement this stuff from ES5: function …

javascript class ecmascript-5 ecmascript-6 traceur