Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

some js es6

const array = [1, 2, 3, 4, 5];

// checks whether an element is even
const even = (element) => element % 2 === 0;

console.log(array.some(even));
// expected output: true
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js
ADD COMMENT
Topic
Name
7+2 =