Questions tagged [ecmascript-2017]

Use this tag for questions about features finalized in ECMAScript 2017. Do *not* use this tag if the code in question merely *uses* one of the features, *unless* the feature is cause of the problem.

Proposals finalized in 2017 include:

387 questions
0
votes
2 answers

How to serialize an object and cast it back to the same class as the original object

I'm new to JavaScript so bear with me if what I'm asking is not "how you do it in JavaScript". Advice on other approaches are welcome. I have a class named State and I need need to serialize objects of that class using JSON.stringify(). The next…
ackh
  • 1,648
  • 2
  • 18
  • 36
0
votes
1 answer

ECMAScript 2017 concurrent async functions with possibility to wait for subpromises that should not be concurrent?

Suppose we have multiple concurrent tasks that each does at least one web request at one point or another and they take a while to complete. Suppose they also may or may not at some arbitrary point in execution run a function that returns a promise.…
0
votes
2 answers

react native code works inline but not when imported

The following code works properly in react native 0.61.5. // userApplication/screens/UserScreen.js import React, {Component} from 'react'; import { Button } from "./../components/arComponents"; class UserScreen extends React.Component { let…
Philip7899
  • 4,599
  • 4
  • 55
  • 114
0
votes
1 answer

Is there a way to jump to specific line?

How to skip "First Message" or to start async function from n'th line? async function oneByOne() { await talk("First Message"); await talk("Second Message?"); await talk("Last Message?"); }
Cem Kaan
  • 2,086
  • 1
  • 24
  • 55
0
votes
2 answers

Make await return thenable, or infinite recursion in awaiting awaitable

Trying to come up with API, mixing in promise functionality like: class Awaitable { constructor () { this.promise = Promise.resolve() } then (fn) { // awaited result must be _this_ instance return this.promise.then(() => fn(this)) …
dy_
  • 6,462
  • 5
  • 24
  • 30
0
votes
0 answers

How to stop executing map function on array index 5 in javascript

I have array of 10 elements, I am mapping to extract array data . I want to stop array executing when compile reached to array index 5 . I know it possible with for loop but I need it in map function. Please help me
Jonas
  • 149
  • 3
  • 10
0
votes
1 answer

What makes ES6 so special?

So I've only recently started to dive head first into web development. One thing I gathered very quickly was that ES5 = old, and ES6 = shiny and new. I figured ES6 was the latest and greatest ES had to offer. But I just found out that ES6 is 3…
0
votes
4 answers

Javascript Conditional Operation with String from Javascript Object

I'm trying to understand the code from this codesandbox. I've understood most of it, but I don't get this line: return
{text}
; selected is a string, and it's never empty, so the empty…
0
votes
1 answer

Assign aliased variables to new object

How can we assign aliased keys to a new object like var obj1 = { c: 1 }; var obj2= ({ f: c } = obj1 ); console.log(obj2); OR var obj1 = { c: 1 }; var obj2= { f: c } = obj1 ; console.log(obj2); is returning {c: 1} instead of {f: 1}. How can to…
Sachin
  • 2,912
  • 16
  • 25
0
votes
1 answer

How to access window or document object in nodejs /es2017

I'm trying to access document.getElementbyID and document.location in my typescript application. But getting error. (node:3024) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: document is not defined…
Nirmal
  • 13
  • 9
0
votes
0 answers

How to access document/window in typescript using es2017?

I'm trying to access window.location.href and document.getElementByID in my > typescript. But getting an error as its undefined. (node:3024) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: document…
Nirmal
  • 13
  • 9
0
votes
1 answer

How to use reset(), .value, and other DOM keys in typescript?

So I'm using typescript for basic funkcionality, however it refuses to compile because of the following error src/app.ts:46:38 - error TS2339: Property 'value' does not exist on type 'HTMLElement'. 46 return document.getElementById(id).value I…
Lukáš Václavek
  • 442
  • 1
  • 6
  • 12
0
votes
1 answer

Fetch As Google Is Showing Blank Page - Reactjs

I have a Reactjs (v.16.6.3) page which its SEO is important to be indexed by Google. Therefore, I checked it with Fetch as Google tool to know what Google-bot renders from this page. However, google shows nothing and only depicts a blank page to…
0
votes
2 answers

Array.every function isn't running on all elements of Object

I'm trying to search inside temp1 if any value has the string "processado" using the following code let temp1 = [{ "id":7089, "value":"R$ 50,00", "name":"Daiany Nascimento", "date":"18/03/2019", "type":"Cobrança", "status":{ …
0
votes
1 answer

Upgrading to Angular 7 Ecma6 not working why?

i just updated my application from angular 6 to angular 7 but some sort of which was working in angular 6 not working in angular 7 it puts browser in infinite loading. For eg: @Component({ selector: 'app-page', template: `
user3458271
  • 638
  • 12
  • 31