UNPKG

lenye_base

Version:

基础方法

10 lines (8 loc) 288 B
/** * Returns true if the provided predicate function returns true for all elements in a collection, false otherwise. */ var all = function (arr) { var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Boolean; return arr.every(fn); }; export default all;