javascript check if duplicates in array 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;
}