Random winner selector
There is not much to be done about the random selector.  However, I would make the function accept an explicit parameter.

That input loop, though, is too complicated. It also fails to handle the "Cancel" button in any way.



function winner(names) {
    return names[Math.floor(Math.random() * names.length)];
}

let names = [];
for (let name; name = prompt('Enter a name:'); ) {
    names.push(name);
}
console.log(winner(names));