My goal is to randomly select Anna 67% of the time, Bob 30% of the time, and Tom 3% of the time. Is there a more streamlined method for achieving this?
Here's what I've come up with:
var names = ['Anna', 'Bob', 'Tom'];
var name = names[Math.ceil(Math.random() * (names.length - 1))];
console.log(name);