This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const random = () => { | |
return Promise.resolve(Math.random()*10) | |
} | |
'Bad Promise Code 💩' | |
const sumRandomAsyncNums = () => { | |
let first; | |
let second; | |
let third; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const orders = [500, 30, 99, 15, 223]; | |
/** | |
* Reduce | |
* @return a single value as output | |
*/ | |
const total = orders.reduce((acc, cur) => acc + cur) | |
/** |