so I understand what's going with this with integers, 23|0 will always return 23 because you're comparing 10111 with 00000 so it will always return 10111.
So I assume this just casts the float to an integer and does the comparison, effectively doing a pseudo math.floor.
Like /u/rcfox pointed out, it doesn't work for negative integers:
Math.floor(-21.12) === -22
// but
-21.12|0 === -21
5
u/HideousNomo Mar 19 '19
I've been using
num | 0for this very thing