Currently tackling a small project with the code provided below. Encountering an issue as it doesn't accommodate duplicates. Seeking advice on how to address this challenge.
Note that by "duplicates" I mean scenarios where Joe can't be paired with Mark and then also be paired with Matt or any other person mentioned in the list.
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!");
}