You can do this using a Set. You have to create a Set and put all the values in your Array, in that Set. Then, you check whether they have the same length or not. If not, you know there are duplicate values, because a Set can only have unique values. It is explained in the link below:
https://medium.com/dailyjs/how-to-remove-array-duplicates-in-es6-5daa8789641c