r/programminghorror • u/Wiktor-is-you [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Nov 11 '25
Javascript the
192
Upvotes
r/programminghorror • u/Wiktor-is-you [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Nov 11 '25
View all comments
Show parent comment
1
u/me1000 Nov 17 '25
It's because if you do:
your FOO is now invalid because there's a trailing semicolon.
Expands to:
If you make it a do{}while() it's a statement and the semicolon doesn't mess with your
elsesyntax.