Skip to content

Instantly share code, notes, and snippets.

@klihelp
Created November 23, 2017 15:58
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 klihelp/16cd0972de6eb463c14c1bc511a76646 to your computer and use it in GitHub Desktop.
Save klihelp/16cd0972de6eb463c14c1bc511a76646 to your computer and use it in GitHub Desktop.
Log Function JS
/**
* Log Function in es6
*/
function log() {
var line = Array.prototype.slice
.call(arguments)
.map(function(argument) {
return typeof argument === 'string' ? argument : JSON.stringify(argument);
})
.join(' ');
document.querySelector('#log').textContent += line + '\n';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment