Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array every

var nums = [1, 2, 3, 4, 5, 6, 7];

function even(ele)
{
    return ele%2 == 0;
    
}
console.log(nums.every(even))
/*console.log will show false since not every element is even*/
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #array
ADD COMMENT
Topic
Name
8+1 =