Get Distinct Values Of Array Javascript Iteration