I know that JavaScript doesn\'t support macros (Lisp-style ones) but I was wondering if anyone had a solution to maybe simulate macros? I Googled it, and one of the solution
function unless(condition,body) { return 'if(! '+condition.toSource()+'() ) {' + body.toSource()+'(); }'; } eval(unless( function() { return false; }, function() { alert("OK"); }));