some and every function
let zz = [11,22,-33];
let allPositve = zz.every(function(value){
return value>=0;
})
console.log(allPositve);
let somePositve = zz.some(function(value){
return value>=0;
})
console.log(somePositve);
node sortingarray.js
false
true
Comments
Post a Comment