I would like to use an anonymous function in the condition of an if-statement
Using Firefox 60.7.2.esr running JS 1.5
I tried something like this, figuring it should work like the anonymous function in a forEach statement:
if (function() {
var b = true;
if (b) {
return true;
} else {
return false;
}
}) {
//do something
}
My actual anonymous function is quite a bit more elaborate, but in principle it should work the same way. The problem seems to be that the anonymous function does not run at all. Is there a way to make it run?