I am wondering how to make an array with functions and then randomizing one and call it. Here is an example of what I have tested.
functions = [f1(), f2(), f3(), f4()];
rand = functions[Math.floor(Math.random() * functions.length)];
$('p').click(function() {
rand[0]();
}
I have searched and tried multiple supposed solutions but none of them worked(including this one: Javascript Array of Functions).