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.
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…
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.…
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…
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?");
}
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))
…
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
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…
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…
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…
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…
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…
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…
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":{
…
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: `