JSFiddle - React, Tailwind, and code Playground

JavaScript

function setGlobal() {
    bar = 1;
}

setGlobal();

// logs true and 1
console.log(window.bar === bar, bar);