Find item in arbitrary-length array based on percentage
<p>I have an array of images</p>

<pre><code>var prizeImage;

//this is a dynamic amount
var result = 55; 

//the length of this array will change. Images will be added/removed
var prizeImageArray = ['image1.png','image2.png','image3.png','image4.png'] 


//I want to avoid having to type each of these if statements. 
if(result &lt; 25){
    prizeImage = prizeImageArray[0];
}
if(result &gt; 26 &amp;&amp; result &lt; 50){
    prizeImage = prizeImageArray[1];
}
if (result...)//and so on
</code></pre>

<p>The above is terrible code.  </p>

<p>I want a method that will allow for the prize image array to change size and to avoid typing each of the if statements. </p>

<p>I hope this makes sense, I have a feeling it doesn't.</p>
