JSFiddle - React, Tailwind, and code Playground

by Hilarius Doren

JavaScript

const promise = Promise.resolve(42)
	.then(value => value - 42)
	.then(value => value / value)
	.catch(() => -21)
	.then(value => value && value.toString())
	.catch(() => 21)
	.then(value => value.charCodeAt(0))
	.catch(() => 42)
	.then(value => value * 2)
	.finally(value => value + 5)