JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id='x'>
DIV X
</div>
<div id='y'>
DIV Y
</div>
</body>
JavaScript
var x = true;
var t = function() {
alert('true');
};
var f = function() {
alert('false');
};
(true ? $("#x").hide : $("#x").show)();
(x ? $("#y").hide : $("#y").show)();
(true ? t : f)();
(x ? t : f)();