1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| var _ = require('lodash')
var users = [ { user: 'barney', age: 36 }, { user: 'fred', age: 40 }, { user: 'pebbles', age: 1 }, ]
var youngest = _.chain(users) .sortBy('age') .map(function (o) { return o.user + ' is ' + o.age }) .head()
console.log(youngest.value())
|