C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
JavaScript handler.isExtensible() MethodThe handler.isExtensible() method a trap for Object.isExtensible(). We can be mostly used for logging or auditing calls to Object.isExtensible (determine if an object is "extensible"). SyntaxisExtensible: function(target) Parameterstarget: The target object. Return valueReturn a Boolean value. Browser Support
Example 1var x = { foo: 1 }; var proxy = new Proxy(x, { isExtensible: function(target) { document.writeln('in isExtensible'); //expected output: in isExtensible return Object.isExtensible(target); } }); document.writeln(Object.isExtensible(proxy)); //expected output: true document.writeln(" Output: in isExtensible true in isExtensible false Example 2const pro={ too:1 } const proxy = new Proxy(pro, { isExtensible: function(target) { document.writeln(' in value : '); return true; } }); document.writeln(Object.isExtensible(proxy)); //expected output: in value : true Output: in value : true Example 3var a = { canEvolve: true }; var b = { isExtensible(target) { return true; }, }; const proxy1 = new Proxy(a, b); document.writeln(Object.isExtensible(proxy1)); // expected output: true Output: true
Next TopicJavaScript handler
|