What do return -1, 1, and 0 mean in this Javascript code?
<p>Here is the context:</p>

<pre><code>function compare (value1, value2) {
    if(value1 &lt; value2) {
        return -1;
    } else if (value1 &gt; value2) {
        return 1;
    } else {
        return 0;
    }
}

var values = [0, 6, 8, 5];
values.sort(compare);
alert(values); // 0,5,6,8
</code></pre>

<p>does <code>-1</code> return the last argument? Like when using <code>-1</code> in an array?</p>
