Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Check if an array contains a object in javascript

const john = {
    'name': 'John Doe',
    'email': 'john.doe@example.com'
};
const jane = {
    'name': 'Jane Doe',
    'email': 'jane.doe@example.com'
};

const list = [john, jane];
let result = list.includes(john);

console.log(result); // true
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Check #array #object #javascript
ADD COMMENT
Topic
Name
1+2 =