0
Why does this code output 4?
function f(x) { if (x==4) return 4; else return(x+1); }; alert (f(1));
4 Answers
+ 8
The output is 2 not 4..
You can write this in SL code playground..
you will see that the output is 2
Check it:
https://code.sololearn.com/WVyh1Q7otevj/?ref=app
+ 3
@Brain no problem..
and good luck bro <3
+ 1
Why would the output not be 2?
+ 1
Thanks Baraa! Had to be sure it wasn't just me.