JSFiddle - React, Tailwind, and code Playground

by Nicolas PUJOL

JavaScript

var state = 0;
function f1() {
    state++;
    fend();
}
function f2() {
    state++;
    fend();
}
function fend() {
    if (state == 2) {
        console.log("fend called");
        state = 0;
    }
}