javascript broken syntax
<p>Alright, I or someone I work with broke the syntax here somewhere, and I'm not sure where, as the debugger is giving me some random garble as the error. Anyway here is the function, I think I'm missing a bracket somewhere, but this is just evading me for some reason.</p>

<pre><code>var sort_by = function(field, reverse, primer) {

   var key = function (x) {return primer ? primer(x[field]) : x[field]};

   return function (a,b) {
       var A = key(a), B = key(b);
       return ((A &lt; B) ? -1 : (A &gt; B) ? +1 : 0)) * [-1,1][+!!reverse];                  
   }
}
</code></pre>
