0

I was looking for a way of detecting the current browser using javascript code and came across an answer mentioned here at the same forum.

My question is: What is the meaning of !! (double exclamation symbol).

The value !!document.documentMode is returning a boolean value depending on whether the current browser is IE or not and the value document.documentMode returns the version of the IE browser.

I want to understand what !! actually signifies.

Community
  • 1
  • 1
hari
  • 1,297
  • 5
  • 17
  • 36

1 Answers1

1

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


!oObject //Inverted boolean

!!oObject //Non inverted boolean so true boolean representation

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

Community
  • 1
  • 1
Alexandre Beaudet
  • 2,774
  • 2
  • 20
  • 29