Giter VIP home page Giter VIP logo

array-some-x's Introduction

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

array-some-x

Tests whether some element passes the provided function.

module.exportsboolean

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

Kind: Exported member
Returns: boolean - true if the callback function returns a truthy value for any array element; otherwise, false.
Throws:

  • TypeError If array is null or undefined.
  • TypeError If callBack is not a function.
Param Type Description
array array The array to iterate over.
callBack function Function to test for each element.
[thisArg] * Value to use as this when executing callback.

Example

import some from 'array-some-x';

function isBiggerThan10(element, index, array) {
  return element > 10;
}

console.log(some([2, 5, 8, 1, 4], isBiggerThan10)); // false
console.log(some([12, 5, 8, 1, 4], isBiggerThan10)); // true

array-some-x's People

Contributors

xotic750 avatar

Watchers

 avatar  avatar

array-some-x's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.