Skip to content

Instantly share code, notes, and snippets.

@bdavidxyz
Last active January 9, 2017 16:24
Show Gist options
  • Save bdavidxyz/59289f3cd5c817b03e8c31f1c8eb265a to your computer and use it in GitHub Desktop.
Save bdavidxyz/59289f3cd5c817b03e8c31f1c8eb265a to your computer and use it in GitHub Desktop.
function labeledCheckboxes (proposals, answers) {
// check pre-conditions
if (_(proposals).isEmpty()) return [];
if !(_(proposals).isArray && _.every(proposals, _.isString)) return [];
if !(_(proposals).isArray && _.every(proposals, _.isBoolean)) return [];
if (_(answers).size() > _(proposals).size()) return [];
// etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment