What is the !! (not not) operator in JavaScript?

I saw some code that seems to use an operator I don’t recognize, in the form of two exclamation points, like so: !!. Can someone please tell me what this operator does?

The context in which I saw this was,


Coerces oObject to boolean. If it was falsey (e.g. 0, null, undefined, etc.), it will be false, otherwise, true.

So !! is not an operator, it’s just the ! operator twice.

Real World Example “Test IE version”:

If you =>

but if you =>