title: Vlookup like function in javascript
body: <p>Actually I have made this on excel using Vlookup but now I am making this on webpage.</p>
  
  <p>I have a input box where user will enter the value</p>
  
  <pre><code>&lt;input class="text" type="text" name="rawScore" onchange="calcpercentile()"&gt;
  </code></pre>
  
  <p>and I have a span of where user can get the result</p>
  
  <pre><code>&lt;span id="percentile"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>I have two arrays</p>
  
  <pre><code>var percentile = [10, 20, 30, 40, 50, 60, 70, 80, 90];
  var rawScores = [1, 3, 5, 7, 10, 12, 18, 25, 27];
  </code></pre>
  
  <p>what code should I write that if I write  so I get the </p>
  
  <pre><code>input       value
  (rawScores)  (percentile)
  1            10
  2            20
  3            30
  4            40
  </code></pre>