Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

every method javascript

// .every accepts a function as an argument, but returns true 
// only if the function matches for every item.

const numbers = [5, 55, 66, 33, 23, 12, 98, 44];

const greaterThanTen = (element) => element > 10;

console.log(numbers.every(greaterThanTen));
//Expected output is false
 
PREVIOUS NEXT
Tagged: #method #javascript
ADD COMMENT
Topic
Name
8+1 =