Created
January 9, 2017 15:54
-
-
Save bdavidxyz/529d960b711ccd8d059fc61abe9294fc 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() - _(definedUserAnswers).size(); // 2 | |
const arrayOfFalse = _.times(sizeDifference, _.constant(false)); // [false, false] | |
return _.chain(definedUserAnswers) // [false, true] | |
.concat(arrayOfFalse) // [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