IT Nursery
I’m digging into the node 7 async/await feature and keep stumbling across code like this function getQuote() { let quote = "Lorem ipsum dolor sit amet, consectetur adipiscing elit...
  • June 1, 2022
  • 0 Comments
Given the following code: var arr = [1,2,3,4,5]; var results: number = await arr.map(async (item): Promise<number> => { await callAsynchronousOperation(item); return item + 1; }); which produces the following...
  • May 11, 2022
  • 0 Comments
I have been going over async/await and after going over several articles, I decided to test things myself. However, I can’t seem to wrap my head around why this...
  • May 10, 2022
  • 0 Comments
How can I reject a promise that returned by an async/await function? e.g. Originally: foo(id: string): Promise<A> { return new Promise((resolve, reject) => { someAsyncPromise().then((value)=>resolve(200)).catch((err)=>reject(400)) }); } Translate into...
  • May 7, 2022
  • 0 Comments
Are there any issues with using async/await in a forEach loop? I’m trying to loop through an array of files and await on the contents of each file. import...
  • April 10, 2022
  • 0 Comments