JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    <div id='x'>
        DIV X
    </div>
    <div id='y'>
        DIV Y
    </div>
    <div id='z'>
        DIV Z
    </div>
</body>

JavaScript

var x = true;
var t = function() {
    $("#z").hide();
};
var f = function() {
    $("#z").show();
};

(true ? $("#x").hide : $("#x").show)();
(x ? $("#y").hide : $("#y").show)();
(x ? t : f)();