1.0.0 • Published 7 years ago
array.some v1.0.0
array.some
tests whether some element in the array passes the test implemented by the provided function
api
const some = require('array.some')
some(array, callback)
- array the array to be processed by the provided function
- callback function to test for each element, taking 3 arguments:
- currentValue the current element being processed in the array
- index the index of the current element being processed in the array
- array the array some() was called upon
example
const some = require('array.some')
some([1, 2, 3, 4, 5, 6, 7, 8, 9], isBiggerThan5)// true
function isBiggerThan5 (ele) {
return ele > 5
}
ISC License (ISC)
1.0.0
7 years ago