Skip to content

Instantly share code, notes, and snippets.

View rimivan's full-sized avatar
🎯
Focusing

rimivan rimivan

🎯
Focusing
View GitHub Profile
const random = () => {
return Promise.resolve(Math.random()*10)
}
'Bad Promise Code 💩'
const sumRandomAsyncNums = () => {
let first;
let second;
let third;
@rimivan
rimivan / useful-javascript-snippets.js
Last active January 12, 2021 17:19
Simple ES6 reference with useful methods
const orders = [500, 30, 99, 15, 223];
/**
* Reduce
* @return a single value as output
*/
const total = orders.reduce((acc, cur) => acc + cur)
/**