1.0.0 • Published 7 years ago

array.some v1.0.0

Weekly downloads
761
License
ISC
Repository
github
Last release
7 years ago

array.some

tests whether some element in the array passes the test implemented by the provided function


Build StatusCode Coverage 100%ISC LicenseNodeJS

JavaScript Style Guide

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)