This function checks if at least one thing in the set passes a given test. It returns a boolean value.

Calling this function on an empty set returns false for any condition!

This function does not generate a change.




Argument Type Description
callback closure Closure to execute on each thing until the closure evaluates to true.

Explanation of the callback argument:

Iterable Arguments Description
set thing, Id Iterate over things in the set. Both thing and id are optional.

Return value

Returns true if at least one thing in the set satisfies the check in the callback function. Otherwise, false.


This code shows an example using some():

users = set({
    name: 'Iris',
    age: 7,
}, {
    name: 'Tess',
    age: 6

a = users.some(|user| user.age > 18); // false
b = users.some(|user| user.age > 6);  // true

// Return both a and b
[a, b];

Return value in JSON format