hasintermediateconst p = new Proxy({}, {
has: (target, key) => key.startsWith('a')
})
console.log('apple' in p) // β true
console.log('banana' in p) // β falseThe has trap intercepts the in operator, allowing you to control which property names are considered present on a proxy.
When the has trap only returns true for 'x', the key 'y' is not visible via in.
Challenge: Verify that 'y' in p is false when has returns key === 'x'.