Click in order · JavaScript and TypeScript course · Module 12: Functional Programming
Validation with Either
Arrange the elements of validation with Either:
Items to click
- return new Left('Missing ID');
- return new Right(data)
- if (!data.id)
- .map(d => ({ ...d, valid: true }))
You can check the correct answer by solving this task in the CodeWorlds game.