Lodash教程

Lodash overSome method

语法

_.overSome([predicates=[_.identity]])
Creates a function that checks if any of the predicates return truthy when invoked with the arguments it receives.

参数

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

输出

(Function) − Returns the new function.

实例

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

输出

true
true
false
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4