SOURCE

console 命令行工具 X clear

                    
>
console
function render() {
	var str = ''
		for(var i in arguments) {
			str += arguments[i] + ' '
		}
	
	document.getElementById('output').innerHTML += str + '<br/>'
}

function clear() {
	document.getElementById('output').innerHTML = ''
}

////////////////////////
var bar = function(p1, p2, custom) {
	render(p1, p2, custom)
}

function caller(func) {
	render('caller: ', typeof func)
  func.call(this, 'p1', 'p2')
}

clear()
caller(bar)
<div id="output">
	
</div>
#output {
	color: green;
  background: #000;
  padding: 10px;
}