const safe = new Proxy({ x: 1 }, { has(t, p) { return p === "x"; } }); console.log("x" in safe, "y" in safe);