+ 1

Why is it var xxx=prompt(); and not just prompt();?

Why are prompt and confirm type popupboxes defined as a variable and alert type popupboxes arent?

10th Nov 2017, 7:44 AM
N8W1nD
N8W1nD - avatar
3 Answers
+ 8
@Nachtwind because you want to store what was entered in a prompt(a string) or a confirm (a boolean) in a variable for later reference
10th Nov 2017, 8:24 AM
David Akhihiero
David Akhihiero - avatar
+ 2
thank you both for the answers, I understand now:)
10th Nov 2017, 8:27 AM
N8W1nD
N8W1nD - avatar