Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<script>
function someHasPropertyValue(objectsArray, property, value) {
for (const item of objectsArray) {
if (item[property] === value)
return true;
};
return false;
}
const data = [
{
firstName: 'John',
lastName: 'Doe',
age: 22
},
{
firstName: 'Jane',
lastName: 'Doe',
age: 25
},
{
firstName: 'Mary',
lastName: 'Doe',
age: 15
}
];
const result = someHasPropertyValue(data, 'age', 15);
document.write(result);
</script>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 507