Skip to main content

Command Palette

Search for a command to run...

Promise.reject()

Published
1 min readView as Markdown
new Promise((resolve, reject) => reject("Error"))
  .then((value) => console.log(value))
  .catch((error) => console.log(error)); // 'Error'

// Instead do this,

Promise.reject("Error")
  .then((value) => console.log(value))
  .catch((error) => console.log(error)); // 'Error'

More from this blog

Codedrops.tech

49 posts