JSFiddle - React, Tailwind, and code Playground

by TheDiamondDoge

JavaScript

Promise.reject('a')
	.catch(p => p + "b")
	.catch(p => p + "c")
  .then(p => p + "d")
  .finally(p => console.log(p + "e"))
  .then(p => console.log(p))

a().then(console.log)

function b() {
	return Promise.reject(2);
}

async function a() {
	try {
  	await b();
  } catch(e) {
  	return e;
  } finally {
  	return 1;
  }
}