Top "Ecmascript-6" questions

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

Getting Unexpected Token Export

I am trying to run some ES6 code in my project but I am getting an unexpected token export error. …

javascript ecmascript-6 webpack babeljs
How to scroll to an element?

I have a chat widget that pulls up an array of messages every time I scroll up. The problem I …

javascript reactjs ecmascript-6
forEach is not a function error with JavaScript array

I'm trying to make a simple loop: const parent = this.el.parentElement console.log(parent.children) parent.children.forEach(child =&…

javascript ecmascript-6 vue.js
How to import and export components using React + ES6 + webpack?

I'm playing around with React and ES6 using babel and webpack. I want to build several components in different files, …

reactjs ecmascript-6 webpack
How to update nested state properties in React

I'm trying to organize my state by using nested property like this: this.state = { someProperty: { flag:true } } But updating state …

javascript reactjs ecmascript-6 setstate
How to convert Map keys to array?

Lets say I have the following map: let myMap = new Map().set('a', 1).set('b', 2); And I want to obtain […

javascript dictionary ecmascript-6
Concatenating variables and strings in React

Is there a way to incorporate React's curly brace notation and an href tag? Say we have the following value …

javascript html reactjs ecmascript-6
Programmatically navigate using react router V4

I have just replaced react-router from v3 to v4. But I am not sure how to programmatically navigate in the …

reactjs ecmascript-6 react-router-v4
module.exports vs. export default in Node.js and ES6

What is the difference between Node's module.exports and ES6's export default? I'm trying to figure out why I …

node.js module ecmascript-6
"unexpected token import" in Nodejs5 and babel?

In js file, i used import to instead of require import co from 'co'; And tried to run it directly …

javascript node.js ecmascript-6 babeljs package.json