Code:
var userFunctionstack = [
function() {
alert("user function 1");
},
function() {
alert("user function 2");
},
function() {
alert("user function 3");
},
function() {
alert("user function 4");
}
];
for(var i = 0; i < userFunctionstack.length; ++i)
userFunctionstack[i]();

That's the "neat" way of doing it. We can do it with plain functions like yours too (as opposed to an array of functions, which was what my code was for):
Code:
for(var i = 1; typeof window['userFunctionstack' + i] === 'function'; ++i)
window['userFunctionstack' + i]();
Bookmarks