Skip to content

Instantly share code, notes, and snippets.

@ourmaninamsterdam
Last active December 16, 2015 03:29
Show Gist options
  • Save ourmaninamsterdam/5370657 to your computer and use it in GitHub Desktop.
Save ourmaninamsterdam/5370657 to your computer and use it in GitHub Desktop.
Debug list. Accepts primitive values and arrays.
function log(){
var debug = document.getElementById('debug'),
reverse = true,
log = Array.prototype.slice.call( arguments, 0 ).join('{join}').replace(/{join}/g, '<br>');
debug.innerHTML = (reverse)? log + '<br>' + debug.innerHTML : debug.innerHTML + '<br>' + log;
}
log(myObject.name, myObject.thing, 'With a label: ' + myObject.label);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment