Schrodinger's function
Promises and throw considered harmful
Take for example the code below
function createUser(email: string): User {
if (users.includes(email)) {
throw new Error(`User with email ${email} already exists`)
}
...
return newUser;
...
joshuaamaju.hashnode.dev3 min read