Proxy has()
Intercepts the in operator.
has(obj, prop) {
return Reflect.has(obj, prop);
}
Triggered by:
"property" in proxy
Parameters>
- obj - the target object
- prop - the property being accessed
- receiver - the value of this for setters (usually the proxy itself)
Must Return
- true
- false
Proxy Handler Methods:
handler.apply()
handler.construct()
handler.defineProperty()
handler.deleteProperty()
handler.get()
handler.getOwnPropertyDescriptor()
handler.getPrototypeOf()
handler.has()
handler.isExtensible()
handler.ownKeys()
handler.preventExtensions()
handler.set()
handler.setPrototypeOf()
Browser Support
handler.has() is an ECMAScript6 (ES6 2015) feature.
JavaScript 2015 is supported in all browsers since June 2017:
| Chrome 51 |
Edge 15 |
Firefox 54 |
Safari 10 |
Opera 38 |
| May 2016 | Apr 2017 | Jun 2017 | Sep 2016 | Jun 2016 |