how to check if every value is unique javascript code example
Example: javascript check if array has duplicates
function hasDuplicates(array) {
return (new Set(array)).size !== array.length;
}
function hasDuplicates(array) {
return (new Set(array)).size !== array.length;
}