Skip to content

Instantly share code, notes, and snippets.

@backnotprop
Created October 27, 2017 17:31
Show Gist options
  • Save backnotprop/2e85ce2ce68ab1923ee063964abb7739 to your computer and use it in GitHub Desktop.
Save backnotprop/2e85ce2ce68ab1923ee063964abb7739 to your computer and use it in GitHub Desktop.
// eliminates two people from each others preference list
function eliminateChoices(rejecter, rejected) {
let remove1 = _.findIndex(rejected.choices, function(p) { return p.id == rejecter.id; });
rejected.choices.splice(remove1, 1);
let remove2 = _.findIndex(rejecter.choices, function(p) { return p.id == rejected.id; });
rejecter.choices.splice(remove2, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment