Número Mais Próximo //Repositório JavaScript

Array = [-10,-3,0,10,15]
Indexes of the nearest numbers to:
5 = 2
9 = 3
15 = 4
-15 = 0
-2 = 1