Troubleshooting 'Either' Function Error in TypeScript Code
Hello everybody. What's wrong with this code?
Here's the error I'm getting:
Here's the error I'm getting:
function eitherFromRandom(random: number): Either.Either<'fail', number> {
return random > 0.5 ? Either.right(random) : Either.left('fail')
} return random > 0.5 ? Either.right(random) : Either.left('fail')
~~~~~~