Questions tagged [ecmascript-next]

For questions about upcoming ECMAScript features that are not scheduled to be part of a specific version yet (anything that is a stage 3 or lower proposal).

Proposals for new ECMAScript features follow a specific process, where they go through the following stages:

  • Stage 0 (Strawman)
  • Stage 1 (Proposal): The committee expects to devote time to examining the problem space, solutions and cross-cutting concerns
  • Stage 2 (Draft): The committee expects the feature to be developed and eventually included in the standard
  • Stage 3 (Candidate): The solution is complete and no further work is possible without implementation experience, significant usage and external feedback.
  • Stage 4 (Finished): The addition will be included in the soonest practical standard revision

Proposals in stage 4 are definitely added to one of the next releases of the language specification. This tag is for questions about proposals in stage 0 - stage 3.

Important Links:

379 questions
24
votes
6 answers

TypeError: Object.entries is not a function

Why do I keep getting this error when trying to run my Node.js/Express server? Is this a part of the newer ES7? What do I need to be able to run an app using these new features?
user7917402
24
votes
2 answers

Why are derived class property values not seen in the base class constructor?

I wrote some code: class Base { // Default value myColor = 'blue'; constructor() { console.log(this.myColor); } } class Derived extends Base { myColor = 'red'; } // Prints "blue", expected "red" const x = new…
Ryan Cavanaugh
  • 164,706
  • 43
  • 239
  • 219
24
votes
4 answers

Babel support for Object.entries

I'm looking at the stage 3 proposal of Object.values/Object.entries and I'd really like to use it in my current JavaScript project. However, I can't figure out whether there's any Babel preset which supports it. Since the GitHub repository linked…
damd
  • 4,569
  • 4
  • 36
  • 66
22
votes
3 answers

How can I use decorators today?

I see decorators being used today already in some javascript code. My question is really two fold. First: If decorators have not even been finalized how is it possible to use them in production code, today? Won't browser support be…
21
votes
1 answer

Using latest JavaScript features in TypeScript, such as ES2018

I have tried searching through TypeScripts documentation on their configurtion and can't seem to find the answer to what should be a simple question. Simply, how does one configure the typescript compiler so that it knows what JavaScript feature…
ste2425
  • 4,213
  • 2
  • 17
  • 32
20
votes
2 answers

Unable to use Arrow functions inside React component class

I've started a project where I use React JS for the front end an node js in backend. I used webpack for bundling up JS files. I used babel along with other necessary stuff. When I use arrow functions inside a react class, it gives a syntax error,…
TRomesh
  • 3,786
  • 5
  • 38
  • 61
17
votes
3 answers

Clean way to keep original variable and destructure at the same time

Is there a cleaner way to do this (with anything that is at least an ES draft and has a babel plugin, i.e., ES6, ES7, etc.): const { a, b } = result = doSomething(); Where I want to keep the overall result as one singular object, but also…
samanime
  • 21,211
  • 7
  • 69
  • 122
16
votes
1 answer

How do I use and apply JavaScript decorators?

I am trying to understand how to use decorators in a very simple piece of code, so I can apply this concept to my bigger project. Taking cue from Addy Osmani's article here, I created a simple piece of code as below. Say, I have a class called Cat,…
Mopparthy Ravindranath
  • 2,390
  • 4
  • 32
  • 58
14
votes
2 answers

What is the difference between class method vs property function vs property arrow function in typescript?

I was wondering - what is the difference between class method, class property which is a function and class property which is an arrow function? Does the 'this' keyword behave differently in the different variants of the method? class Greeter { …
Combine
  • 2,868
  • 23
  • 28
14
votes
2 answers

ES6/Next: object destructuring with rest - grouping

I have: const props = { gallery: [], select: () => null, one: 1, two: 2, } I can destructure it with: const {gallery, select, ...other} = props I will have three variables now: gallery = [] select = () => null other = {one: 1,two: 2} Is…
Kocur4d
  • 5,888
  • 6
  • 26
  • 45
14
votes
1 answer

async / await not working in combination with fetch

I'm trying to use ES7 async / await together with fetch. I know I'm close but I can't get it to work. Here is the code: class Bar { async load() { let url = 'https://finance.yahoo.com/webservice/v1/symbols/goog/quote?format=json'; …
Jeanluca Scaljeri
  • 19,619
  • 37
  • 147
  • 259
13
votes
1 answer

Why So Many IANA Time Zones Names?

Javascript allows you to see what time it is in another timezone if you specify the IANA given name of that timezone. For example: new Date().toLocaleString("en-US", {timeZone: "America/Chicago"}); Below you can see that IANA provides multiple…
Lonnie Best
  • 6,765
  • 9
  • 44
  • 81
13
votes
3 answers

ESLint unexpected character '@' for JS decorators

I'm trying to use decorators in my JS project, however ESLint is throwing an error stating that the @ symbol is a unexpected character. My code: @observable items = []; My .eslintrc: { "parserOptions": { "ecmaVersion": 6, …
user818700
13
votes
1 answer

Destructure Spread off Import ES6

import {Component, ...actions} from '../MyModule'; Seems to be throwing a linting error. Is there a reason why you can't "spread" on an ES6 import statement?
majorBummer
  • 6,357
  • 5
  • 29
  • 44
13
votes
4 answers

How to use async await function object in Javascript?

Say I have a function object- setObj : function(a,b){ obj.a = a; obj.b = b; } If I have to use async & await on this function object, how do I do it? If the same was written in function (function way), say- async function setObj(a,b){ …
bozzmob
  • 10,774
  • 15
  • 44
  • 67
1 2
3
25 26