title: JavaScript not comparing minimum greater than maximum number values
body: <p>Why is "greater than" comparisons for number values in JavaScript not working. The example below keeps returning true even when the mini number is less than the maxi.</p>
  
  <p>mini and maxi are form input values. This example is using jQuery to get the values, but could easily be stripped. </p>
  
  <pre><code>var mini = $('form#filterPrice input.min').val(); //eg. 500
  var maxi = $('form#filterPrice input.max').val(); //eg. 1500
  
  if( mini.valueOf() &gt; maxi.valueOf() ) { //also used: mini &gt; maxi
      alert('test'); //alerts "test" even when mini is less than maxi
  $('form#filterPrice input.min').val( maxi ); //should switch values if mini &gt; maxi
  $('form#filterPrice input.max').val( mini );
  }
  </code></pre>
  
  <p>Replacing "mini > maxi" with "Math.max(mini, maxi) == mini" works fine. So, the following does work:</p>
  
  <pre><code>var mini = $('form#filterPrice input.min').val(); //eg. 500
  var maxi = $('form#filterPrice input.max').val(); //eg. 1500
  
  if( Math.max(mini, maxi) == mini ) {
      alert('test'); 
  $('form#filterPrice input.min').val( maxi );
  $('form#filterPrice input.max').val( mini );
  }
  </code></pre>