Skip to content

Instantly share code, notes, and snippets.

@vielhuber
Last active September 22, 2017 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vielhuber/cac969a8ad0146175f658a60ceefdd06 to your computer and use it in GitHub Desktop.
Save vielhuber/cac969a8ad0146175f658a60ceefdd06 to your computer and use it in GitHub Desktop.
debug current variables (live) inside function scope #js
var debug = ["var1", "var2", "var3"];
window.setInterval(function() {
$('#debug').remove();
$('body').append('<div id="debug" style="position:fixed;top:0;left:0;"></div>');
for(var item of debug) {
$('#debug').append(item+": "+eval(item)+"<br/>");
}
},1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment