// How to use everyMethod?
// If I want to check that my product prices are greater than 10000 or not for this every method is the best choice for me...
const userCart = [
{ producdId: 1, producdPrice: 355 },
{ producdId: 2, producdPrice: 5355 },
{ producdId: 3, producdPrice: 34 },
{ producdId: 4, producdPrice: 3535 },
];
// ======================
console.log(userCart.every((e) => e.producdPrice >= 10000));
// So simple it's simple like this :)
// ==========The End==========
let numbers = [1, 3, 5];
let result = numbers.every(function (e) {
return e > 0;
});
console.log(result);
Code language: JavaScript (javascript)