Check If All Elements In Array Match A Condition Javascript

[Solved] Check If All Elements In Array Match A Condition Javascript | Solidity - Code Explorer | yomemimo.com
Question : check if all elements in array match a condition javascript

Answered by : kirkpatrick-brown

const isBelowThreshold = (currentValue) => currentValue < 40;
const array1 = [1, 30, 39, 29, 10, 13];
console.log(array1.every(isBelowThreshold));
// expected output: true

Source : | Last Update : Sat, 05 Sep 20

Answers related to check if all elements in array match a condition javascript

Code Explorer Popular Question For Solidity