<script> let value = 0; Object.defineProperty(window, "a", { get() { return (value += 1); }, }); if (a === 1 && a === 2 && a === 3) { console.log("object"); } </script>
<script> let value = 0; Object.defineProperty(window, "a", { get() { return (value += 1); }, }); if (a === 1 && a === 2 && a === 3) { console.log("object"); } </script>