Checking if objects in array fulfill a condition - Array.every, Array.includes

PHOTO EMBED

Tue Jun 29 2021 11:47:04 GMT+0000 (UTC)

Saved by @hisam #object #array #javascript #vanilla

cars.some(car => car.color === "red" && car.type === "cabrio");
// output: true

cars.every(car => car.capacity >= 4);
// output: false
content_copyCOPY