console.log(random(['win', 'mac', 'lin'], [70, 20, 10])); // random 70% - 'win', 20% - 'mac', 10% - 'lin'
console.log(random(['win', 'mac', 'lin'], [2, 1, 1])); // random 50% - 'win', 25% - 'mac', 25% - 'lin'
console.log(random(['win', 'mac', 'lin'], [.9, .05, .05])); // random 50% - 'win', 25% - 'mac', 25% - 'lin'
console.log(random(true)); // random true or false
console.log(random(false)); // random true or false
console.log(random(1)); // random 0 or 1
console.log(random(1.999)); // random 0 or 1 or 2
console.log(random([0, 1, 2, 3])); // random 0 or 1 or 2 or 3
console.log(random(['a', 'b'])); // random 'a' or 'b'
console.log(random(1, 2)); // random 1 or 2
console.log(random(1, 4)); // random 1 or 2 or 3 or 4
console.log(random(['win', 'mac', 'lin'], [70, 20, 10])); // random 70% - 'win', 20% - 'mac', 10% - 'lin'
console.log(random(['win', 'mac', 'lin'], [2, 1, 1])); // random 50% - 'win', 25% - 'mac', 25% - 'lin'
console.log(random(['win', 'mac', 'lin'], [.9, .05, .05])); // random 50% - 'win', 25% - 'mac', 25% - 'lin'
console.log(random(true)); // random true or false
console.log(random(false)); // random true or false
console.log(random(1)); // random 0 or 1
console.log(random(1.999)); // random 0 or 1 or 2
console.log(random([0, 1, 2, 3])); // random 0 or 1 or 2 or 3
console.log(random(['a', 'b'])); // random 'a' or 'b'
console.log(random(1, 2)); // random 1 or 2
console.log(random(1, 4)); // random 1 or 2 or 3 or 4