Since you have a collection of names, not key pairs, it is better to use an array to store your names, not a hash.
With an array, you can use Math.floor and Math.random to generate an index to search in an array of names.
names[Math.floor(Math.random() * names.length)]
source share