In my application I have an array of objects which contains users:
var users = [
{id: 1, firstName: 'Max', lastname: 'Muster', birthdate: '10.10.1990', number: '123'},
{id: 2, firstName: 'Mia', lastname: 'Gruber', birthdate: '11.03.2001', number: '254'}
];
When I click on a button I trigger an event which posts a user object into this array:
var obj = {id: 3, firstName: 'Mia', lastname: 'Gruber', birthdate: '11.03.2001', number: '284'}
//This object should not be possible to add to the array
Before posting this object into the array I want to check if there is already a user with the combination of firstName + lastName + birthdate in the array. I already saw some javascript methods like array.some() but as far as I know this works with just 1 value. Is there any method to check multiple values?