title: using jquery, how would i find the closest match in an array, to a specified number
body: <p>using jquery, how would i find the closest match in an array, to a specified number</p>
  
  <p>For example, you've got an array like this:</p>
  
  <p>1, 3, 8, 10, 13, ...</p>
  
  <p>What number is closest to 4?</p>
  
  <p>4 would return 3<br>
  2 would return 3<br>
  5 would return 3<br>
  6 would return 8<br></p>
  
  <p>ive seen this done in many different languages, but not in jquery, is this possible to do simply</p>