+ 5
Difference between alert() and window.alert()
Can some one explain me the difference between this two as they work exaclty the same way.
4 Respuestas
+ 9
window in JS is a global object, that means you can access it anywhere throughout your code. So, alert() becomes a global method / function. Therefore, you can call alert function of window object as window.alert() or alert().
The choice is upto you!
+ 3
They both perform the same functuon though personally, I prefer alert()
+ 2
I think it will help you https://stackoverflow.com/questions/13459907/what-is-the-difference-between-alert-and-window-alert :)