I have this code
bot.webex.memberships.list({roomId: bot.room.id})
.then((memberships) => {
for (const member of memberships.items) {
if (member.personId === bot.person.id) {
// Skip myself!
continue;
}
let names = (member.personDisplayName) ? member.personDisplayName :member.personEmail;
bot.say(`Hello ${member.personDisplayName`);
Which produce multiple output line by line Like this:
John Dou
Alfred Pennivor
Michel Lee
I need to create one array from this output, randomize this array and bot must say only one random name from array. Please note number of names maybe different
PS I try to use split but get 3 different arrays instead of one.