JSFiddle - React, Tailwind, and code Playground

JavaScript

function a() {
    return ++x; // I believe you want prefix increment, not postfix
}

function b() {
    var x = b.x;
    eval(String(a)); // dynamic scoping
    b.x = a();
    return x;
}

b.x = 0;

alert([b(), b(), b()]);