Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Test Page</title>
<style>
  body {
    font-family: sans-serif;
  }
</style>
</head>
<body>
</body>
</html>
 
display("Creating implicit global");
xxx = 12232;
display("Enumerating window properties");
for (var j in window) { 
  if (j==='xxx') {
    display("Found the global");
  }
}
display("Done enumerating window properties");
display("Does the global exist? " + ("xxx" in window));
display("The global's value is " + xxx);
display("Also available via <code>window.xxx</code>: " +
        window.xxx);
function display(msg) {
  var p = document.createElement('p');
  p.innerHTML = String(msg);
  document.body.appendChild(p);
}
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers