What I want to do here is use the fewest bytes to call function f
only if the variable a
is not null. The function n
shown will work fine, but according to my web browser, function m
won't work. The browser states:
expected expression, got ';'
I then proceeded to take out the colon, figuring maybe that would do the trick, but I get the error "syntax error".
Is there a way I can shorten function n to a smaller size and have it still work or should I just stick with function n
?
function g(){}
function f(){}
function m(){a?f()g():;}
function n(){if(a){f();g()}}