The Math.random[MDN] function chooses a random value in the interval [0, 1). You can take advantage of this to choose a value randomly.
var chosenValue = Math.random() < 0.5 ? value1 : value2;
The Math.random[MDN] function chooses a random value in the interval [0, 1). You can take advantage of this to choose a value randomly.
var chosenValue = Math.random() < 0.5 ? value1 : value2;