const scores = [86, 70, 56, 52, 78, 83];
const is_passed = scores.every( score => score > 33 );
console.log(is_passed);
// -> true
In the above code snippet, we have an array of scores that contains marks obtained by a student. If all marks are greater than 33 then the student is passed. It will return true if the student is passed. And false if the student is failed.
0 Comments