Getting unique values from a JavaScript array using Set