Skip to content
Malexion edited this page Nov 6, 2016 · 2 revisions

__.flow(object)

  • object The item to process with an function chain.

Examples

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);

Clone this wiki locally