JSFiddle - React, Tailwind, and code Playground
JavaScript
var state = 0;
function f1() {
state++;
fend();
}
function f2() {
state++;
fend();
}
function fend() {
if (state == 2) {
console.log("fend called");
state = 0;
}
}