Top "Ecmascript-6" questions

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

What's the difference between using "let" and "var"?

ECMAScript 6 introduced the let statement. I've heard it that it's described as a local variable, but I'm still not quite …

javascript scope ecmascript-6 var let
"Uncaught SyntaxError: Cannot use import statement outside a module" when importing ECMAScript 6

I'm using ArcGIS JSAPI 4.12 and wish to use Spatial Illusions to draw military symbols on a map. When I add …

javascript ecmascript-6 arcgis arcgis-js-api
Node.js - SyntaxError: Unexpected token import

I don't understand what is wrong. Node v5.6.0 NPM v3.10.6 The code: function (exports, require, module, __filename, __dirname) { import express …

javascript node.js npm ecmascript-6
Using Node.js require vs. ES6 import/export

In a project I'm collaborating on, we have two choices on which module system we can use: Importing modules using …

javascript node.js ecmascript-6 babeljs
What is "export default" in JavaScript?

File: SafeString.js // Build out our basic SafeString type function SafeString(string) { this.string = string; } SafeString.prototype.toString = function() { return "" + …

javascript node.js ecmascript-6
How to add multiple classes to a ReactJS Component?

I am new to ReactJS and JSX and I am having a little problem with the code below. I am …

javascript css reactjs ecmascript-6
ES6 class variable alternatives

Currently in ES5 many of us are using the following pattern in frameworks to create classes and class variables, which …

javascript class ecmascript-6
Adding script tag to React/JSX

I have a relatively straightforward issue of trying to add inline scripting to a React component. What I have so …

javascript reactjs ecmascript-6 react-jsx
Can (a== 1 && a ==2 && a==3) ever evaluate to true?

Moderator note: Please resist the urge to edit the code or remove this notice. The pattern of whitespace may be …

javascript ecmascript-6
Filter object properties by key in ES6

Let's say I have an object: { item1: { key: 'sdfd', value:'sdfd' }, item2: { key: 'sdfd', value:'sdfd' }, item3: { key: 'sdfd', value:…

filter ecmascript-6