I have followed the answer to a previous question but I am not getting the results. I am generating a random number and based on the number, I want to call 1 of four functions:
var functionArray[single, double, triple, quadruple];
function main() {
ranNum = Math.floor(Math.random() * functionArray.length);
x = functionArray[ranNum](); /* is this the way to call the function? */
}
/* example of one function in the array */
function single() {
/* do stuff */
return x;
}