Get Minimum Value In Array Javascript Iterations