Can anyone tell me why it's showing error. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can anyone tell me why it's showing error.

function sum(x=0, y = 0) { document.write( x + " + " + y + " = " + (x+y)); } sum(1);

6th Aug 2018, 7:52 AM
Jayakrishna
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.
6th Aug 2018, 8:46 AM
ReimarPB
ReimarPB - avatar
+ 4
Jayakrishna Please edit your most recent answer. Profanity (s****y) is not alowed here in SoloLearn.
6th Aug 2018, 2:41 PM
🐺Michael🐺
🐺Michael🐺 - avatar
+ 2
Could you give u r code Meet Mehta. 'cause I didn't understood what you are saying.
6th Aug 2018, 7:59 AM
Jayakrishna
+ 2
ReimarPB you're right. I'm using shitty tab. Thanx for ur suggestions.
6th Aug 2018, 8:58 AM
Jayakrishna