Created
November 17, 2013 14:54
-
-
Save vikki/7514320 to your computer and use it in GitHub Desktop.
SMR lodash goodness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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