DEV Community

Discussion on: Write beautiful and Elegant Javascript code with short-circuit evaluation.

Collapse
 
fayomihorace profile image
Horace FAYOMI • Edited

indeed, the first version might be more readable as simple code (even if take more lines) is most of the times better code to read.
In my case I use it because it allows me to do the job (getting the length wihout exception) without needing each time to import and call a custom helper function that will do the job instead for reusability purposes.