Skip to content

Instantly share code, notes, and snippets.

@klihelp
Created November 23, 2017 15:58
Show Gist options
  • Select an option

  • Save klihelp/16cd0972de6eb463c14c1bc511a76646 to your computer and use it in GitHub Desktop.

Select an option

Save klihelp/16cd0972de6eb463c14c1bc511a76646 to your computer and use it in GitHub Desktop.

Revisions

  1. klihelp created this gist Nov 23, 2017.
    13 changes: 13 additions & 0 deletions log.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    /**
    * 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';
    }