Skip to content

Instantly share code, notes, and snippets.

@vikki
Created November 17, 2013 14:54
Show Gist options
  • Save vikki/7514320 to your computer and use it in GitHub Desktop.
Save vikki/7514320 to your computer and use it in GitHub Desktop.
SMR lodash goodness
var weWantToMeet = _.chain(smrDevs)
.filter(function isAwesome(smrDev) {
return smrDev.isAwesome;
})
.filter(function isEnthusiastic(smrDev) {
return smrDev.enthusiasmLevel === 'high';
})
.filter(function pingPongProficiency(smrDev) {
// not really :D
return smrDev.pingPongSkillz === 'badass';
})
.value();
var devsJoiningUnruly = _.chain(weWantToMeet)
.map(function nomCake(newDev){
newDev.cakeConsumption = 'high';
return newDev;
})
.forEach(function learnLots(newDev){
function learn(lang){
console.log('i know ' + lang + ' fu');
}
_(['scala',
'javascript',
'java',
'haskell']).forEach(learn);
})
.value();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment