-
Notifications
You must be signed in to change notification settings - Fork 0
Flow
Malexion edited this page Nov 6, 2016
·
2 revisions
-
objectThe item to process with an function chain.
var target = [
{ name: 'sally', income: 200000 },
{ name: 'jill', income: 10000 },
{ name: 'frank', income: 2000 },
{ name: 'foobar', income: 100000000 }
];
var result = __.flow(target)
.isArray()
.sort({ dir: 'desc', key: x => x.income })
.map(x => x.name)
.filter(x => x.contains('a'))
.value([]); // param for default if not set
console.log(result);