Understanding the double exclamation point
<p>I'm trying to understand what exactly the double exclamation mark does. Yes, I saw <a href="https://stackoverflow.com/questions/784929/what-is-the-not-not-operator-in-javascript">this question,</a> with lots of answers. So I know in principle what it does, but I don't know why one would ever need to use it.</p>

<p>From what I understand, it converts the value to a boolean. So let's say I have the following code:</p>

<pre><code>var myBool = !!(index === 0 || index &gt; len);
</code></pre>

<p>Can't I just leave out the <code>!!</code> and I will get the same result:</p>

<pre><code>var myBool = (index === 0 || index &gt; len);
</code></pre>

<p>What do I gain by adding <code>!!</code>? Is't it already a boolean vaule?</p>