February 2018
Intermediate to advanced
298 pages
8h 22m
English
The isExtensible trap is executed when we check if the object is extensible or not, using the Object.isExtensible() method. It takes only one parameter--that is, the target object. It must return a Boolean value indicating whether the object is extensible or not.
Here is a code example that demonstrates how to use the isExtensible trap:
const proxy = new Proxy({age: 12}, { isExtensible(target) { return Object.isExtensible(target); } }); console.log(Reflect.isExtensible(proxy)); //Output "true"
Read now
Unlock full access