Show window variables

by ffMathy

HTML

<button id="display">Show variable data</button>
<button id="clear">Clear all variables</button>

JavaScript

var someVariable = "lolololol";
var otherVariable = "qkwdkqwdkqwkd";

var globalContext = this;

$(function() {
    $("#display").click(function() {
        alert(someVariable + "/" + otherVariable);
    });
    
    $("#clear").click(function() {
        for(var i in globalContext) {
            alert("Deleting " + i);
            delete i;
        }
    });
}