Source Code:
(back to article)
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <h1>Global object</h1> <script> var globalVar = 10; alert(window.globalVar); //10 became a property of the global object </script> </body> </html>
Result:
Report an issue