The logical operator "not" (!) lets you convert a truthy statement to a false result, and a falsy statement to a true result. Using two not operators together (!!) lets you convert a truthy value to the boolean result true and a falsy value to the boolean result false.

JavaScript will evaluate the not operator before any of the other logical operators; it has the highest precedence.

Here's a table of when an expression table will result in what value given two comparisons:

!truthy → false
!falsy → true
!!truthy → true
!!falsy → false

For more information on the logical or operator, read this blog post.