- Lodash Tutorial
- Lodash - Home
- Lodash - Overview
- Lodash - Environment Setup
- Lodash - Array
- Lodash - Collection
- Lodash - Date
- Lodash - Function
- Lodash - Lang
- Lodash - Math
- Lodash - Number
- Lodash - Object
- Lodash - Seq
- Lodash - String
- Lodash - Util
- Lodash - Properties
- Lodash - Methods
- Lodash Useful Resources
- Lodash - Quick Guide
- Lodash - Useful Resources
- Lodash - Discussion
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