What is the difference between alert() and window.alert() functions? It seems to work the same.
alert()
window.alert()
Because window is the global object, you can call an alert either by it's shorthand: alert( 'Hello!' ); or by referencing the global object specifically: window.alert( 'Hello!' );
window
alert
alert( 'Hello!' );
window.alert( 'Hello!' );
They are the same.
1.4m articles
1.4m replys
5 comments
57.0k users