UNPKG

ut2

Version:

一个现代 JavaScript 实用工具库。[点击查看在线文档]。

17 lines (14 loc) 420 B
import forEach from './forEach.js'; import identity from './identity.js'; var some = function (collection, predicate) { if (predicate === void 0) { predicate = identity; } var result = false; forEach(collection, function (item, index, arr) { if (predicate(item, index, arr)) { result = true; return false; } }); return result; }; export { some as default };