Lodash - overSome method



Syntax

_.overSome([predicates=[_.identity]])

Creates a function that checks if any of the predicates return truthy when invoked with the arguments it receives.

Arguments

  • [predicates=[_.identity]] (...(Function|Function[])) − The predicates to check.

Output

  • (Function) − Returns the new function.

Example

var _ = require('lodash');
var func = _.overSome([Boolean, isFinite]);

console.log(func('1'));
console.log(func(null));
console.log(func(NaN));

Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

Output

true
true
false
lodash_util.htm
Advertisements