count unique values in array javascript