screen-console.js (356B)
1 function ScreenConsole(element) { 2 this._element = element; 3 } 4 5 ScreenConsole.prototype.log = function () { 6 var text = ""; 7 for (var i = 0; i < arguments.length; i++) { 8 text += arguments[i] + " "; 9 } 10 console.log(text); 11 this._element.innerText += text + "\n"; 12 }; 13 14 ScreenConsole.prototype.clear = function () { 15 this._element.innerText = ""; 16 };