New course! Every coder should learn Generative AI!
Try a free lesson+ 1
How can it be 6?
function subst(x,y){ return x; return y; return x-y; } document.write(subst(6, 2));
3 Answers
+ 1
A function stops running after a return statement. So this function executes return x (6), and then stops running.
+ 1
Thank you so much for your support.. :)
+ 1
No problem ;)