How do I pass functions as a parameter in JavaScript.
In the code below if I call whatMustHappen (TWO(),ONE()) I want to them to fall in the sequence of the x and the y on the whatMustHappen function.
Right now it fires as it sees it in the parameter.
var ONE = function() {
alert("ONE");
}
var TWO = function() {
alert("TWO");
}
var THREE = function() {
alert("THREE");
}
var whatMustHappen = function(x, y) {
y;
x;
}
whatMustHappen(TWO(), null);
whatMustHappen(TWO(), ONE());