DEV Community

Discussion on: What is the Double bang (!!) operator in JavaScript?

Collapse
 
amrishpandey profile image
amrishpandey • Edited

what i learned that if a value is true or false.
by default it does not return anything if it is not explicitly set with true or false boolean . that means by default it returns the value only.

if single bang (!) is added before the value, it returns false.
if double bang (!!) is added before the value, it returns true.

am i correct ?