Last active
December 31, 2016 09:49
-
-
Save bdavidxyz/5ea94ea13eff0da105c0d434ca7ebae1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const sizeDifference = _(proposals).size() - _(userAnswers).size(); // 2 | |
const completeWithFalse = _.times(sizeDifference, _.constant(false)); // [false, false] | |
return _.chain(userAnswers) // [false, true] | |
.concat(completeWithFalse) // [false, true, false, false] | |
.zip(proposals) // [[false, 'prop 1'], [true, 'prop 2'], [false, 'prop 3'], [false, 'prop 4']] | |
.map(_.reverse) // [['prop 1', false], ['prop 2', true], ['prop 3', false], ['prop 4', false]] | |
.value(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment