Spelling !! is a common way to convert a true or false variable into a true boolean.
For instance:
var foo = null; if (!!foo === true) { // Code if foo was "truthy" }
After the first ! applies to foo , the return value is true . Marking this value again makes it false , which means that the code inside the if block if not entered.
source share