I can choose one person from my list in JS

I am trying to choose one person from my list in JS but whenever I check the out it give me all of them
I think I have problem in array but I couldn’t solve my problem.

Here is my code.

names = ["Mary", "Anna" ,"Angel", "Nish" , "Jack", "Pam"];


function whosPaying(names) {
 var numberOfPeople = names.length;
 var randomPersonPosition = Math.floor(Math.random() * numberOfPeople );
 var randomPerson = names [randomPersonPosition];
 return randomPerson + " is going to pay."
}

I had to write

console.log(whosPaying(names))

without this line my code showed me all 6 name