title: Get the closest number out of an array
body: <p>I have a number from minus 1000 to plus 1000 and I have an array with numbers in it. Like this:</p>
  
  <pre><code>[2, 42, 82, 122, 162, 202, 242, 282, 322, 362]
  </code></pre>
  
  <p>I want that the number I've got changes to the nearest number of the array.</p>
  
  <p>For example I get <code>80</code> as number I want it to get <code>82</code>.</p>