loading...

re: Advanced TypeScript Types cheat sheet (with examples) VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What are some really good real world examples for this? (3,4 examples). Wouldn't the optional operator be enough? function foo(bar?: string) { ...
 

The difference between the two, is that in Maybe the value is required, and in the second one is optional. So, you can have Maybe values and those values would be either defined or not, but would still be required. I have found this to be useful in React.

code of conduct - report abuse