What's the output of following code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's the output of following code?

<html> <head> </head> <body> <script type="text/javascript"> var name= new Array(2); for(i=0;i<2;i++) { name[i]=prompt("enter your name",""); } document.write(name[0] + name[1]); </script> </body> </html>

12th Jan 2017, 4:38 PM
sid
2 Answers
0
But it shows undefined or two commas It's not working properly what's the error
13th Jan 2017, 8:23 AM
sid
- 1
whatever the user entered I'm your first and second spam box.
12th Jan 2017, 4:39 PM
Louis Milotte
Louis Milotte - avatar