Javascript restart prog | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Javascript restart prog

I do a little program in Javascript. I wanted to do a prompt wich ask if yes or not restart the prog. how can I do ? Thanks :)

27th Jul 2017, 6:57 PM
NoxFly
NoxFly - avatar
2 Answers
+ 10
var restart = confirm("Restart the game?"); if (restart) doSomething; else doNothing;
27th Jul 2017, 7:04 PM
The Coding Sloth
The Coding Sloth - avatar
+ 7
thanks !
27th Jul 2017, 7:14 PM
NoxFly
NoxFly - avatar