JSFiddle - React, Tailwind, and code Playground

by Kyle Falconer

HTML

<div id="foo"></div>
<div id="bar"></div>

JavaScript

function compressed(c) {
for(var b=["foo","bar","baz"],a=0;a<b.length;a++){var d=document.getElementById(b[a]);d&&(d.innerHTML=c===b[a]?"found "+c:"found "+b[a]+", but it is not "+c)}
}

function uncompressed(section) {
    var items = ['foo', 'bar', 'baz'];
    for (var i = 0; i < items.length; i++) {
        var elem = document.getElementById(items[i]);
        if (elem) {
            if (section === items[i]) {
                elem.innerHTML = 'found ' + section;
            } else {
                elem.innerHTML = 'found ' + items[i] + ', but it is not ' + section;
            }
        }
    }
}

compressed('foo'); // works... nevermind!

// uncompressed('foo'); // works