DEV Community

Discussion on: The Mysterious Double Tilde (~~) Operation

Collapse
 
havespacesuit profile image
Eric Sundquist

It is a good operator if you want a function that truncates toward zero.

Math.floor(-1.6) // -2
~~-1.6 // -1