Simple logic in javascript
<p>I have four variables of type integer -</p>

<pre><code>var tip_1, tip_2, tip_3, tip_4;
</code></pre>

<p>The value of these variables are getting fill by some other logic which is always between 1 to 10. I need to maintain a hash with variable name as "key" and value as "value" by following these rules -</p>

<ol>
<li><p>The variable with MAX value should be the first element in the hash and so on. e.g. 
if tip_1 = 4, tip_2 = 1, tip_3 = 2, tip_4 = 10 then hash should be something like,
Hash = {tip_4, 10} {tip_1, 4} {tip_3, 2} {tip_1, 1}</p></li>
<li><p>In case of tie following order should be considered -
tip_1 > tip_2 > tip_3 > tip_4;</p></li>
</ol>
