0.1.3 • Published 6 years ago
lists-findlast v0.1.3
lists-findlast
NOTE: lists-findlast was renamed to @extra-lists/find-last.
Get last value in lists that satisfies the test, like Array.find().
const findLast = require('lists-findlast');
// findLast(<lists>, <test function>, [this])
a = ['edge', 'opera', 'chrome'];
findLast([a.keys(), a], (v) => v.includes('r'));
// 'chrome'
a = {s1: 'bing', s2: 'duckduckgo', s3: 'google'};
findLast([Object.keys(a), Object.values(a)], (v, i, lst) => v.length>4);
// 'google'