I have the following list of functions:
var functions = {
blah: function () {
alert("blah");
},
foo: function () {
console.log("foo");
}
};
I am now trying to access a specified index of the functions array, however I'm only getting undefined.
So console.log(functions[0]); returns undefined.
Can anyone explain why this is happening and instruct me on how to call a specified index of a function array in javascript? I need to cycle sequentially through the array, so need to call it by position number rather than name.
functionsis an object, not an array