70
rated 0 times
[
76]
[
6]
/ answers: 1 / hits: 14983
/ 4 Years ago, thu, january 2, 2020, 12:00:00
Hi I have list of values in array as bellow
var users = [{
name: 'John',
email: '[email protected]',
age: 25,
},
{
name: 'Tom',
email: '[email protected]',
age: 35,
},
{
name: 'John',
email: '[email protected]',
age: 25,
}];
I should find duplicates row from the above array (need to compare all the fields name, email, and age)
I have used some function to find a duplicate value as below but need to pass multiple conditions in it. How to do that
const unique = new Set();
const showError = this.users.some(element => unique.size === unique.add(element.name).size);
As I have passed the name I need to verify email and age. How to do that
More From » arrays