Javascript restart prog | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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 Réponses
+ 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