JSFiddle - React, Tailwind, and code Playground
HTML
Is array static: <span id="static"></span>
<input id="makeStatic" type="button" value="Make static" />
JavaScript
function makeStatic() {
ArrayStatic = true;
setValue();
}
function setValue() {
el = document.getElementById("static");
try {
el.textContent = ArrayStatic ? "Array is static" : "Array is not static";
} catch (err) {
el.textContent = "Array is not static";
}
}
setValue();
document.getElementById("makeStatic").onclick = makeStatic;