WHY CAN'T THIS CODE WORK | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

WHY CAN'T THIS CODE WORK

function myAlert(){ p = prompt("WRITE SOMETHING"); if(p === "") { { alert("ITS BLANK"); } setInterval(myAlert, 3000); } else { alert("OK COOL"); } }

3rd Mar 2019, 9:54 PM
Glory222
Glory222 - avatar
1 Answer
+ 2
There should be no piece of code between the if and else statement if(condition){ statement }else{ statement }
3rd Mar 2019, 10:01 PM
Ore
Ore - avatar