JSFiddle - React, Tailwind, and code Playground

by mrlew

HTML

<div id="myLog"></div>

CSS

html {
  font-family: "Lucida Console", Monaco, monospace
}

body {
  background-color: #000;
}

#myLog {
  color: #fff;
  font-weight: 600;
}
}

#myLog {
  white-space: pre-wrap;
}

JavaScript

console.log = function(objToLog) {
	var myLog = document.getElementById('myLog');
  var str = '';
  if (typeof objToLog === 'string') {
  	str = objToLog;
  } else if (typeof objToLog === 'object') { //includes array
  	str = JSON.stringify(objToLog);
  }
  myLog.innerText = myLog.innerText + '\n> ' + str;
}


console.log('log this line');
console.log('log this other line');
console.log([1,2,3]);
console.log({ key: 'value' });