The difference I see is, when you work with a nullable type, each function has to do the check
so
const add3 = (val) => val ? val + 3 : null;
const multiplyBy10 = (val) => val ? val * 10 : null
So the argument type goes from being
val
to
val?
where the calling code doesn't necessarily have type safety since this argument is now optional (it can be a number or null and either is acceptable) instead of the following (with no conditionals or ternaries) const add3 = val => val + 3;
const multiplyBy10 = val => val * 10;
This is possible cause
optional.map
implicitly handles the case where the data is missing by default, its built into the data type and the code you write doesn't need to worry about it. Its the responsibility of the Optional object.