What does the double exclamation !! operator mean?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/784929/what-is-the-operator-in-javascript">What is the !! operator in JavaScript?</a><br>
  <a href="http://stackoverflow.com/questions/2168406/what-does-double-exclamation-point-mean">What does !! (double exclamation point) mean?</a>  </p>
</blockquote>



<p>I am going through some custom JavaScript code at my workplace and I am not able to understand the following construct. </p>

<pre><code>var myThemeKey = (!!$('row') &amp;&amp; $('row').hasClassName('green-theme')) ? 'green' : 'white';
</code></pre>

<p>I understand everything on the above line except <code>!!</code> operator. I assume that it is a <code>NOT</code> operator and <code>NOT</code> of <code>NOT</code> is the original value but why would someone do a <code>NOT</code> of <code>NOT</code>? </p>

<p>Can someone please help me understand what is happening on the above line of code?</p>
