loading...

re: How to Shorten JavaScript Conditionals with Short-Circuiting VIEW POST

FULL DISCUSSION
 

Hi Reed!

I run this in Browser console:
123 && 456 && null && false && 789
null
It searches first falsy and returns it if falsy was not found then the last truthy value is returned.

I always forgot how it works. It seems now I have remembered it forever.
Thank you!

Code of Conduct Report abuse