Skip to content
Subhajit Sahu edited this page May 7, 2020 · 15 revisions

Check if atleast one value in lists passes the test, like Array.some().

const some = require('@extra-lists/some');
// some(<lists>, <test function>, [this])

a = ['defence', 'of', 'the', 'ancients'];
some([a.keys(), a], (v) => v.length===2);
// true
a = {c1: 'sniper', c2: 'invoker', c3: 'kunkka'};
some([Object.keys(a), Object.values(a)], (v, i, lst) => !v.endsWith('er'));
// true

extra-lists

Clone this wiki locally