how to check current javascript object is duplicate value exist or not 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;
}