Skip to content

Instantly share code, notes, and snippets.

@koonuf
Created September 23, 2015 20:59
Show Gist options
  • Save koonuf/d0dfe86d1b5081d8eb90 to your computer and use it in GitHub Desktop.
Save koonuf/d0dfe86d1b5081d8eb90 to your computer and use it in GitHub Desktop.
<html>
<head>
<script>
function setAndClear() {
action();
clear();
}
function clear() {
delete window.myInst;
}
function action() {
window.myInst = new MyClass();
}
function MyClass() {
this.a = "test";
}
</script>
</head>
<body>
<button onclick="setAndClear()">Set and clear</button>
<button onclick="action()">Action</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment