title: JavaScript Closest point from mouse
body: <p>Before you comment, yes i have checked other questions aswell...
  like <a href="https://stackoverflow.com/questions/24791010/how-to-find-the-coordinate-that-is-closest-to-the-point-of-origin">this article</a>, or <a href="https://stackoverflow.com/questions/6170392/find-closest-point-to-mouse-position">this one</a>, or maybe even <a href="https://stackoverflow.com/questions/31048526/closest-point-of-a-set-to-a-given-point">this one</a>. However, i couldn't find how to set the point of origin. So, let's say i have an array picture X coords and picture Y coords</p>
  
  <p>(on a grid of 100*100)
  x /y
  92/81
  82/47
  81/03 </p>
  
  <p>Now i have the mouseX and mouseY.
  Does anyone know how to make a function that gives you the closest point x and y values in JavaScript?</p>
  
  <p>Thanks in advance!</p>