Sky said: Really wish I could get my head wrapped around all the dot-functions like chain and filter. About the only one I can reliably remember is _.each That chain syntax is just syntactic sugar around passing the output of the previous function as the input to the next. let tokensByFirstLetter = _.chain(msg.selected)
.map((o)=>getObj('graphic',o._id))
.filter(_.isUndefined)
.reduce((m,o)=>{
let l=(o.get('name')[0]||'').toLowerCase();
m[l]=m[l]||[];
m.push(o);
return m;
},{})
.value(); Is the same as: let tokens = _.map(msg.selected, (o)=>getObj('graphic',o._id));
let tokensNoUndefined = _.filter(tokens,_.isUndefined);
let tokensByFirstLetter = _.reduce(tokensNoUndefined, (m,o)=>{
let l=(o.get('name')[0]||'').toLowerCase();
m[l]=m[l]||[];
m.push(o);
return m;
},{});
without all the intervening data structures.