The issue with that, though, is returning `undefined` is really no different to 
returning `null` in a sense. Null is considered bad because errors can crop up 
from not handling null as a return value from a function. Using `undefined` 
does not solve the problem. It also isn’t able to explain the failure if there 
could be multiple reasons.

But in cases where we do want to identify the reason for a failure and it’s not 
necessarily exceptional, ES does not currently provide a standard way to handle 
such an instance. Over the years, I’ve gone for using try..catch anyway in such 
instances, but many of my colleagues would disagree.

es-discuss mailing list

Reply via email to