JavaScript: Taking the highest 2 numerical values out of a series of 4 possible values
<p>I'm trying to take the highest two values out of 4 possible variables and add them together, while ignoring the lesser two values. My values will be anywhere between 1 and 5.</p>

<p>So, for example, if I have the variables:</p>

<pre><code>Trait 1 = 3
Trait 2 = 3
Trait 3 = 2
Trait 4 = 1
</code></pre>

<p>The script should pick up the 3 and the 3, but not the 2 and the 1. If I change the values around so that I have:</p>

<pre><code>Trait 1 = 4
Trait 2 = 3
Trait 3 = 1
Trait 4 = 5
</code></pre>

<p>The script should use the 4 and the 5, but not the 3 and the 1. How would I go about doing this?</p>
