Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

every method

// 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==========
 
PREVIOUS NEXT
Tagged: #method
ADD COMMENT
Topic
Name
3+6 =