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.
The has trap receives (target, key). You can conditionally return true only for specific keys.
Challenge: Verify that 'x' in p is true when has returns key === 'x'.