lexi
@lexi

if you need to make sure that a few variables are not negative, you usually do this:

0<=a &&0<=b &&0<=c 4+6*n chars

but instead you can do this:

0<=a |b |c 4+2*n chars

that saves 4 characters per argument!! this works because | is the bitwise OR operator, and the nice thing is that this also works for the sign, so if the sign is 1 (negative) on any number, the end result will be negative, so you OR all args together you get a negative number if any number is negative, and you can compare that to zero!

i think my new years resolution should be to avoid touching JS


You must log in to comment.

in reply to @lexi's post: