every loop javascript code example
Example 1: every in javascript
let data = [ {status: true}, {status: false}, {status: true} ]
let result = data.every((i) => {
return i.status === true
})
console.log(result) // false
Example 2: javaascript all
function isBigEnough(element, index, array) {
return element >= 10;
}
[12, 5, 8, 130, 44].every(isBigEnough);