Skip to content

Instantly share code, notes, and snippets.

View matiasfacio's full-sized avatar
🎯
Focusing

Matias Facio matiasfacio

🎯
Focusing
View GitHub Profile
function willThrow(){
return new Promise((_, rej)=> {
setTimeout(()=> {
rej(throw Error('Something went wrong))
}, 1000)
})
}
willThrow().catch(e => console.log(e)) // output: Something went wrong