function Calc(x,y) { z = x + y; return z; } || function Calc(4,5); & document.write ( functionCalc(4,5) ); Are these two same? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

function Calc(x,y) { z = x + y; return z; } || function Calc(4,5); & document.write ( functionCalc(4,5) ); Are these two same?

Please tell me, As I mentioned, isn't there any different between those two function calling types? Then why they mention those two types in the lesson?

29th Nov 2020, 2:04 AM
Nishara Sewminie
Nishara Sewminie - avatar
1 Answer
+ 4
The document.write version actually displays the result on the webpage, while the first version doesn't, only calculates it but discards of it right after.
29th Nov 2020, 2:08 AM
inxanedev!
inxanedev! - avatar