Skip to content

Instantly share code, notes, and snippets.

@sanrodari
Created July 22, 2017 21:59
Show Gist options
  • Save sanrodari/914e9288753cb7c375164f493e9f3d06 to your computer and use it in GitHub Desktop.
Save sanrodari/914e9288753cb7c375164f493e9f3d06 to your computer and use it in GitHub Desktop.
Examples for `window.demoObject` and `window.demoArray`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<body>
<script>
window.demoObject = {};
window.demoArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
function handleClick(e) {
console.log("I'm window.demoObject", window.demoObject);
console.log("I'm window.demoArray", window.demoArray);
}
</script>
<button onclick="window.handleClick()">Click me!</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment