Created
November 23, 2017 15:58
-
-
Save klihelp/16cd0972de6eb463c14c1bc511a76646 to your computer and use it in GitHub Desktop.
Log Function JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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