我正在尝试运行一个随机函数,但还没有完全弄清楚:
<script>
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() }); }
</script>
进而:
<button onclick="randomchords()" >Get some random chords</button>
我在正确的轨道上吗?