math.random returns last function in array
Hi,
strictly this is a javascript question, but am posting here because the functions involved use jQuery.
I've made a function which is supposed to return a randomly-selected function from an array of five.
I've been testing by changing the order in the array, clearing cache, using different browsers, but I'm always getting the last function in the array. "Always" meaning ten iterations of clearing cache and histpry, and trying again.
function jun12() {startEm('june12','welcome12')}
function jul01() {startEm('july1','welcome1')}
function jul02() {startEm('july1_2','welcome1_2')}
function jul17() {startEm('july1_17','welcome1_17')}
function julpass() {startEm('july_pass','welcpass')}
function doHK() {
var a = jun12()
var b = jul01()
var c = jul02()
var d = jul17()
var e = julpass()
var hk = [a,b,c,d,e]
jacket = Math.floor(Math.random() * hk.length); return hk[jacket];
}
Any ideas?