You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What if a function throws undefined? I thought I should mention it. I can't really think of any way to gracefully handle that. I mean, a void function that throws is now just returning, but maybe that's the point, since if you're throwing undefined anyway, is anyone really going to care?
I'm willing to bet that a function which throws undefined really doesn't care any more.
I think the same logic probably applies to throwing the other falsey values.
I thought of rethrowing anything that doesn't extend Error, but I don't think we should rethrow anything. If someone isn't throwing an Error instance, they're not expecting anyone else to use their code.
The text was updated successfully, but these errors were encountered:
Arlen22
changed the title
what about throw;?
what about throw; (and throw undefined || null || 0 || false || "";)
Sep 14, 2024
What if a function throws undefined? I thought I should mention it. I can't really think of any way to gracefully handle that. I mean, a void function that throws is now just returning, but maybe that's the point, since if you're throwing undefined anyway, is anyone really going to care?
I'm willing to bet that a function which throws undefined really doesn't care any more.
I think the same logic probably applies to throwing the other falsey values.
I thought of rethrowing anything that doesn't extend Error, but I don't think we should rethrow anything. If someone isn't throwing an Error instance, they're not expecting anyone else to use their code.
The text was updated successfully, but these errors were encountered: