I would like assign setInterval() to pass an operator as an argument by following the Answer of LiraNuna
function actualFunction(passedValue:Number, compareFunction:Function) {
/* ... */
if(compareFunction(passedValue, staticValue)) {
/* ... Do something ... */
}
/* ... */
}
actualFunction(6, function(x:Number, y:Number) {
return x > y;
});
from this link pass < or > operator into function as parameter?
But I don't seem to know how to do it since only the function name is called when initiating setInterva().
Typical initiation:
function actualFunction(passedValue:Number, compareFunction:Function) {
/* ... */
if(compareFunction(passedValue, staticValue)) {
/* ... Do something ... */
}
/* ... */
}
setInterval(actualFunction,10)
Now, I want to assign
actualFunction(6, function(x:Number, y:Number) {
return x > y;
});
within setInterval(), how would I do it?