Skip to content

Instantly share code, notes, and snippets.

@arkitrave
Last active October 9, 2015 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arkitrave/22178a4caed38faef29e to your computer and use it in GitHub Desktop.
Save arkitrave/22178a4caed38faef29e to your computer and use it in GitHub Desktop.
Secret Santa generator
function secretSantaGenerator (num) {
var participants = _.shuffle(_.range(1, num));
return _.map(participants, function (val, index, list) {
return [
val,
list[index + 1] ? list[index + 1] : list[0]
];
});
}
console.log(secretSantaGenerator(10));
@rcaloras
Copy link

Updated on theReq.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment