Solving this issue is actually quite simple. Choose a name randomly from an array of names.
Here is my approach:
var names = [ 'nick', 'rock', 'danieel' ];
function randPicker(names) {
var randNum = Math.floor((Math.random() * 10));
var name = randNum <= (names.length - 1) ? console.log(names[randNum]) : randPicker(arguments[0]);
};
However, I can't help but feel that this code could be improved. Are there better, more efficient ways to achieve the same result?