how to use await to console
function resolveAfter2Seconds(x) {
return new Promise(resolve => {
setTimeout(() => {
resolve(x);
}, 2000);
});
}
async function f1() {
var x = await resolveAfter2Seconds(10);
console.log(x); // 10
}
f1();
Also in JavaScript:
- JavaScript's automatic semicolon insertion (ASI)
- ngx-translate angular 11
- lodash map
- showing difference between dates in minutes js
- create react app scaffolding
- remove all spaces from a string javascript
- asking questions javascript in console
- expo login using facebook error after login react native
- react native multiple touchableopacity
- add class to html tag javascript
- ajax.complete(handler) example jquery
- abstraction in javascript
- command reboot android app react native adb command
- js console log input value
- javascript style inline react
- js check if attribute exists
- Error: Can't resolve 'fs' webpack
- You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
- jquery get all select options
- check browser locale javascript
- scroll to top
- react dropdown menu stack overflow
- convert shp to geojson python
- check if string contains substring javascript