Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't see the utility when JS already has an option type that's deeply integrated into the language: promises. The one advantage I could see in a hand-rolled option would be forgoing the extra event loop ticks used with promise resolution, but then you're limited to writing synchronous code.

In other languages, I normally use option types when things can fail in unexpected ways, which almost always means I/O.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: