VOOZH about

URL: https://www.geeksforgeeks.org/javascript/collect-js-some-method/

⇱ Collect.js some() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Collect.js some() Method

Last Updated : 9 Dec, 2020

The some() method is used to check whether the given collection contains a given item or not and returns the corresponding boolean value.

Syntax:

collect(array).some(key/value)

Parameters: The collect() method takes one argument that is converted into the collection and then some() method is applied on it. The some() method holds the key/value as parameter.

Return Value: This method checks whether the given collection contains a given item or not and returns the corresponding boolean value.

Below example illustrate the some() method in collect.js:

Example 1:

Output:

true

Example 2:

Output:

true
false
Comment
Article Tags: