I have an array which consists of 6 values. I am running Math.random to shuffle it. However, it's shuffling the array every time and displaying a value which is repeating. I want to shuffle the array and get 1 unique value. This value should be removed from the array until every other value if fetched. For example, if an array has items 1,2,3,4 and after shuffling it the answer is 3. Now, I want it to exclude the 3 and fetch a new value from 1,2,4.
I
const params = {
icon_emoji: ':laughing:'
};
var members=['1','2','3','4','5','6','7'];
var assignee = members[Math.floor(Math.random()*members.length)];
bot.postMessageToChannel('general', `It's ${assignee}'s turn today!`, params);
}
function results() {
const params = {
icon_emoji: ':laughing:'
};
bot.postMessageToChannel('general', `Inside results`, params);
}