How to run a randomly selected function in JavaScript?
<p>I'm trying to run a random function but haven't quite figured it out: </p>

<pre><code>&lt;script&gt;

function randomFrom(array) {return array[Math.floor(Math.random() * array.length)];}

function randomchords(){randomFrom(['poop()', 'poop2()', 'poop3()']);}               



function poop() { $(function() {ionian_c_vi() });  }                          

function poop2() {  $(function() {ionian_c_iii() }), $(function() {ionian_c_iv() });  }                      

function poop3() { $(function() {ionian_c_vi() }), $(function() {ionian_c_i() }), $(function() {ionian_c_ii() });  }  

&lt;/script&gt;
</code></pre>

<p>and then:</p>

<pre><code>&lt;button onclick="randomchords()" &gt;Get some random chords&lt;/button&gt;
</code></pre>

<p>Am I on the right track?</p>
