Why does this JavaScript code doesn't work | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

Why does this JavaScript code doesn't work

function tvseries(teen,were,wolf) { alert(teen+ ","+were+" and "+wolf+" are your best tv series movies"); } teen = prompt ("which is your first best series movie "); teen = confirm ("are you sure"); teen = alert ("so go on"); were = prompt ("choose you second series movie"); were = confirm ("again are you sure"); were = alert("so continue"); wolf = prompt("choose your last best tv series movies"); wolf = confirm("at last are you deadly sure"); wolf = alert("you finshed your work here"); tvseries(teen,were,wolf); /*It says undefined when you put input to the code it it a problem on argument or what*/

31st Jul 2021, 5:49 AM
Jano c͓̽o͓̽d͓̽e͓̽r͓̽
Jano c͓̽o͓̽d͓̽e͓̽r͓̽ - avatar
1 Answer
+ 9
It's happening because you are overwriting the teen, were, and wolf value in alert and confirm. Maybe you want something like this: https://code.sololearn.com/WA6a2a228a11
31st Jul 2021, 6:10 AM
The future is now thanks to science
The future is now thanks to science - avatar