JSFiddle - React, Tailwind, and code Playground

by poonia

HTML

<div id="update"></div>

JavaScript

function htmlLog(str) {
    document.getElementById("update").innerHTML += str + "<br>"
}
var TL = {
    displayInfo: function (sectionType, fileName) {
        if (sectionType == "sectionA") {
            htmlLog("inside if");
            sectionType = "ListA";
        } else {
            htmlLog("inside else");
            sectionType = "ListB";
        }
        htmlLog(sectionType);
    }
};

TL.displayInfo("sectionA");