Why exactly do we need to use this alert ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why exactly do we need to use this alert ??

4th Oct 2017, 2:28 PM
Swastishree Dinesh Bhat
Swastishree Dinesh Bhat - avatar
2 Answers
+ 3
Is this related to the Tutorials/Lessons? I mean...which alert? In general it's just: alert("Message to show visitors"); You can also concatenate values: var x =3; alert("The variable x is set to: " + x);
4th Oct 2017, 3:20 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
Yeah, following @Andrew G...: Alerts stop events on the main thread. They are 'modal' windows and disruptive. https://en.m.wikipedia.org/wiki/Modal_window "...[they] create a mode that disables the main window..." I try to use them as minimally as possible: debug and deliberate interruption.
4th Oct 2017, 5:48 PM
Kirk Schafer
Kirk Schafer - avatar