JSFiddle - React, Tailwind, and code Playground

JavaScript

function a()
{
    alert("a");
}

function b()
{
    alert("b");
}

function c(f)
{
    f();
}

var x = 1;  //change to '0' to see other function call
var fn = (x===3) ?  a: b;
c(fn);