
Array.prototype.every() – Returns **true** only if *all* elements satisfy the condition.
๐ Syntax
const bool = array.every((element, index, array) => {
return /* condition */;
}, thisArg);
๐งช Example
const nums=[2,4,6];
console.log(nums.every(n=>n%2===0)); // true
Comments
Post a Comment