I'm working on a small project and trying to figure this out. Below is my code. Obviously this isn't accounting for duplicates. I'm struggling with how to account for this. Any recommendations?
When I said duplicates I meant that Joe couldn't pair with Mark then also Matt and Joe be a pair.
var people = ["Joe", "Amy", "Garrett", "Mark", "Matt", "Bri", "Rithy", "Rob", "Sandro", "Sharmila"];
for (i = 0; i < 5; i++) {
var pick1 = Math.floor(Math.random()*11);
var pick2 = Math.floor(Math.random()*11);
while (pick1 === pick2) {
pick2 = Math.floor(Math.random()*11);
}
console.log(people[pick1] + " and " + people[pick2] + " are a
group!");
}