I agree with your detailed comment. There are more readable built-in functions for many of these tricks. Some of these tricks don't handle all the cases well (like using || for default breaks if zero is given and should be considered a valid input).
These are more "cute" tricks or "hacks" than ones you should be pulling into your production code.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree with your detailed comment. There are more readable built-in functions for many of these tricks. Some of these tricks don't handle all the cases well (like using
||
for default breaks if zero is given and should be considered a valid input).These are more "cute" tricks or "hacks" than ones you should be pulling into your production code.