Possible Duplicate:
What is the !! operator in JavaScript?
What does !! (double exclamation point) mean?
I am going through some custom JavaScript code at my workplace and I am not able to understand the following construct.
var myThemeKey = (!!$('row') && $('row').hasClassName('green-theme')) ? 'green' : 'white';
I understand everything on the above line except !!
operator. I assume that it is a NOT
operator and NOT
of NOT
is the original value but why would someone do a NOT
of NOT
?
Can someone please help me understand what is happening on the above line of code?