When is it proper to add a return at the end of a JavaScript function?
<p>I have seen some developers place a return at the end of their JavaScript functions like this:</p>

<pre><code>$(".items").each(function(){
    mthis = $(this);
    var xposition = some .x() position value;
    if(xposition &lt; 0){
        mthis.remove();
        return;
    }
});
</code></pre>

<p>Is having a return even necessary?  I know that <code>return false</code> cancels out of a loop early and I know that <code>return x</code>, returns a value, but having just return??? What does that mean?</p>

<p>Sorry - I forgot to put an end } at the very end of the code.  the return is in the if conditional.</p>

<hr>

<p><strong>New Update - just discovered that the intent of the loop was to cancel out the nth .item that entered the loop. so return false is my replacement for a simple return; (which means undefined anyway).  Thanks everyone for the  help!</strong></p>
