JSFiddle - React, Tailwind, and code Playground

by JakobJingleheimer

HTML

<ul id="log">
</ul>

JavaScript

function log(content) {
    var log = document.getElementById('log');
    log.innerHTML += '<li>'+content+'</li>';
}

var foo;
var bar = '';
var baz = [];
var quz = foo;

log('foo: '+foo);
// log('foo.length '+foo.length); // this will cause a fatal error
log('bar.length: '+bar.length);
log('baz.length: '+baz.length);
log('qux: '+qux); // this causes a fatal error