Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript wait for multiple promises

const promise1 = Promise.resolve(3);
const promise2 = 42;
const promise3 = new Promise((resolve, reject) => {
  setTimeout(resolve, 100, 'foo');
});

Promise.all([promise1, promise2, promise3]).then((values) => {
  console.log(values);
});
// expected output: Array [3, 42, "foo"]
Comment

PREVIOUS NEXT
Code Example
Javascript :: js get date in ms 
Javascript :: letter javascript regex 
Javascript :: string interpolation javascript 
Javascript :: express get raw path 
Javascript :: how to get datetime in nodejs 
Javascript :: on spacebar press javascript 
Javascript :: remove element from dictionary javascript 
Javascript :: livewire upload progress 
Javascript :: how create an index mongodb 
Javascript :: ajax jquery errors 
Javascript :: javascript get element by custom attribute 
Javascript :: how to detect which key is pressed in javascript 
Javascript :: javascript date get future 5minutes 
Javascript :: react counter input 
Javascript :: set variable to object without editing old object js 
Javascript :: split every n character js 
Javascript :: how to find out which version of react 
Javascript :: array.filter async 
Javascript :: javascript validate date 
Javascript :: cypress click link contains text 
Javascript :: json.stringify parameters 
Javascript :: bignumber to number javascript 
Javascript :: get document jquery 
Javascript :: npx react-native run-ios --configuration Release device 
Javascript :: How to calc() height in react native for styling 
Javascript :: how to import your external js 
Javascript :: json to csv nodejs 
Javascript :: remove first row from table jquery 
Javascript :: jquery get element max height 
Javascript :: javascript find and replace text in html 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =