javascript how to check if array has any matching values 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;
}