What is the use !! in javascript

Possible duplicate:
What!! (not) in JavaScript?

I came across a code that uses !! , which means it’s logical not for me.

  app.isArray = Array.isArray || function(object) { return !!(object && object.concat && object.unshift && !object.callee); }; 

What is the difference between use !! and not using?

(my guess !! converts the result to a Boolean type. If my assumption is true, why is this so?)

+4
source share
1 answer

!! It simply inverts the contents of double to a boolean value. Here are some examples:

 !! true === true !! false === false 
+5
source

All Articles