what is the difference between window.alert and alert?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what is the difference between window.alert and alert??

24th Aug 2016, 11:00 AM
Vishakha Nehe
Vishakha Nehe - avatar
5 Answers
+ 1
can you please explain how it is working?
24th Aug 2016, 2:07 PM
Vishakha Nehe
Vishakha Nehe - avatar
+ 1
They are strictly the same. Prefixing alert() with window is optional.
24th Aug 2016, 2:44 PM
Zen
Zen - avatar
+ 1
is same, just in browser Object's top _proto_ is 'window'
25th Aug 2016, 5:35 PM
Voo Deng
Voo Deng - avatar
0
they are the same
25th Aug 2016, 12:03 PM
Junlong Wang
Junlong Wang - avatar
0
alert() is a method window.alert() here window is a object But both are work same
26th Aug 2016, 5:35 PM
Arifur Rahman
Arifur Rahman - avatar