Creates a function that checks if **any** of the `predicates` return truthy when invoked with the arguments it receives.
const func = overSome([Boolean, isFinite])
func('1')
// => true
func(null)
// => true
func(NaN)
// => false
Name | Type | Attribute | Description |
---|---|---|---|
predicates | The predicates to check. |
{ "comment": "/**\r\n * Creates a function that checks if **any** of the `predicates` return\r\n * truthy when invoked with the arguments it receives.\r\n *\r\n * @since 4.0.0\r\n * @category Util\r\n * @param {Function[]} [predicates=[identity]]\r\n * The predicates to check.\r\n * @returns {Function} Returns the new function.\r\n * @example\r\n *\r\n * const func = overSome([Boolean, isFinite])\r\n *\r\n * func('1')\r\n * // => true\r\n *\r\n * func(null)\r\n * // => true\r\n *\r\n * func(NaN)\r\n * // => false\r\n */", "meta": { "range": [ 524, 667 ], "filename": "overSome.js", "lineno": 25, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100006708", "name": "overSome", "type": "FunctionDeclaration", "paramnames": [ "iteratees" ] }, "vars": { "": null } }, "description": "Creates a function that checks if **any** of the `predicates` return\rtruthy when invoked with the arguments it receives.", "since": "4.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Util", "value": "Util" } ], "params": [ { "type": { "names": [ "Array." ] }, "optional": true, "defaultvalue": "[identity]", "description": "The predicates to check.", "name": "predicates" } ], "returns": [ { "type": { "names": [ "function" ] }, "description": "Returns the new function." } ], "examples": [ "const func = overSome([Boolean, isFinite])\r\rfunc('1')\r// => true\r\rfunc(null)\r// => true\r\rfunc(NaN)\r// => false" ], "name": "overSome", "longname": "overSome", "kind": "function", "scope": "global", "___id": "T000002R000624", "___s": true, "filepath": "overSome.js" }