Questions tagged [ecmascript-2019]

ECMAScript 2019 (ES2019) is the 10th version of the ECMAScript language. Among others, it adds Object.fromEntries, Array#flat and Array#flatMap to the language, and makes small adjustments to the specification. Only use this tag where the question specifically relates to new features or technical changes provided in ECMAScript 2019.

ECMAScript 2019 (ES2019) is the 10th version of the language.

The following proposals have been merged:

Links

7 questions
4
votes
1 answer

How to Enable Private Method Syntax Proposal in React App?

I got "Class private methods are not enabled." error when running npm start on a project using leading # to indicate private methods. I followed this answer: https://stackoverflow.com/a/55822103/4258041 to enable the decorator and it worked, but I…
Yan Yang
  • 1,804
  • 2
  • 15
  • 37
1
vote
1 answer

How to convert ECMAScript 12 to ECMAScript 10

I wrote a JS File, some of the codes in it are in ECMAScript 12. The problem is all my devices support only ECMAScript 10. This was the file Javascript Is there any online converters available, or how can I do it manually?
Random Kindle
  • 400
  • 1
  • 2
  • 12
1
vote
0 answers

How would you access or override a private property of a base class inside a derived class declaration?

How would you do this without: exposing the private property of the base class publicly through setters and getters such as in this answer or having to duplicate any relevant methods and properties of the base class into the derived class The…
1
vote
1 answer

modify return values from Object.fromEntries

I am trying to modify the values of an object by using .fromEntries(). As you can see in the picture below, I am literally returning a modified Array of hours, but after the function ends, it returns the complete Array, instead of the updated…
Jonathan Sandler
  • 323
  • 3
  • 17
0
votes
2 answers

Typescript spread prevent overwrite with undefined

When using spread operator , prevent overwriting keys with new value undefined Consider an object bleh1 and bleh2 const bleh1 = { name: "ajnskdas", foo: "oof", bar: "something" } const bleh2 = { foo: "oofElse", bar: undefined, booz:…
Solaris
  • 674
  • 7
  • 22
0
votes
1 answer

Object.keys vs Object.value - .keys mutates and .value does not. Why is this?

I am trying to change the values inside an object in Javascript, Object.values while running a forEach loop would seem to make the most sense to me but Object.keys (obj[key]) actually updated the value on the object. Here is my code to explain…
SamJ
  • 3
  • 1
0
votes
1 answer

Property 'flatMap' does not exist on type 'string[]'. NOT AN ES2019 PROBLEM

I have this example set up on StackBlitz. It won't compile because there is a line that uses flatMap. The error says: Property 'flatMap' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler…
Atticus29
  • 4,190
  • 18
  • 47
  • 84