+ 2
Can anyone tell me why it's showing error.
function sum(x=0, y = 0) { document.write( x + " + " + y + " = " + (x+y)); } sum(1);
4 Answers
+ 2
Jayakrishna Your code works fine for me. The problem might be that your device doesn't support ES6. (If that's the problem, you should remove the "= 0" from your code.)
Meet Mehta It is completely unnecessary to store x+y in another variable.
+ 4
Jayakrishna
Please edit your most recent answer. Profanity (s****y) is not alowed here in SoloLearn.
+ 2
Could you give u r code Meet Mehta. 'cause I didn't understood what you are saying.
+ 2
ReimarPB you're right. I'm using shitty tab. Thanx for ur suggestions.