 <p>The abstract operation that converts to a boolean is called <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-9.2" rel="nofollow"><code>ToBoolean</code></a>:</p> <ul> <li>Undefined: <code>false</code></li> <li>Null: <code>false</code></li> <li>Boolean: The result equals the input argument (no conversion).</li> <li>Number: The result is <code>false</code> if the argument is <code>+0</code>, <code>−0</code>, or <code>NaN</code>; otherwise the result is <code>true</code>.</li> <li>String: The result is <code>false</code> if the argument is the empty String (its length is zero); otherwise the result is <code>true</code>.</li> <li>Object: <code>true</code>.</li> </ul> <p>However, this operation is internal and not available.</p> <p>But there are some workaround to use it:</p> <ul> <li><p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.9" rel="nofollow">Logical NOT Operator ( ! )</a></p> <pre><code>!!variable; </code></pre></li> <li><p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.12" rel="nofollow">Conditional Operator ( ? : )</a></p> <pre><code>variable ? true : false; </code></pre></li> <li><p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.6.1.1" rel="nofollow">Boolean</a></p> <pre><code>Boolean(variable) </code></pre></li> </ul>