Return 0 as integer not bool
<p>I have a function where if successful, it returns an integer, but if not it just returns <code>false</code>.</p>

<p>Here's part of my code:</p>

<pre><code>    function hellofunc(x) {
//....

        if (returnvalue.length == 1) {
            return returnvalue[0];
        } else if (returnvalue.length &gt; 1) {
            return returnvalue[rx(0, returnvalue.length - 1)];
        } else {
            return false;
        }
    }
</code></pre>

<p>When the function calls this -> <code>return returnvalue[0];</code> it gives <code>0</code> as an integer.</p>

<p>But when I call <code>hellofunc(something);</code> I see it writes to console "0" but when I type something false it returns <code>false</code>,</p>

<p>JavaScript thinks <code>0</code> is <code>false</code>? So what do I do here? Do I do this?</p>

<pre><code>hellofunc(something)!==false
</code></pre>

<p>Or is there any better solution?</p>
