title: Sorting a value pair in Javascript
body: <p>I must be missing the proper term or else I'm sure I could find the answer by searching... in any case, here's what I want to do.</p>
  
  <p>Through javascript, I get four variables (A, B, C, and D) that I would like to sort, and still keep track of the variable name (since it's encoded with meaning information).</p>
  
  <p>Sample Data:</p>
  
  <pre><code>A = 2;
  B = 1;
  C = 4;
  D = 3;
  </code></pre>
  
  <p>What I need to do now is sort them in value order (4,3,2,1) such that I can actually know the variable name ordering (C,D,A,B).</p>