The Proxy.revocable() method is used to create a revocable Proxy object.


Proxy.revocable(target, handler);


Return value

A newly created revocable Proxy object is returned.


A revocable Proxy is an object with following two properties {proxy: proxy, revoke: revoke}.

A Proxy object created with new Proxy(target, handler) call.
A function with no argument to invalidate (switch off) the proxy.

If the revoke() function gets called, the proxy becomes unusable: Any trap to a handler will throw a TypeError. Once a proxy is revoked, it will remain revoked and can be garbage collected. Calling revoke() again has no effect.


var revocable = Proxy.revocable({}, {
  get: function(target, name) {
    return "[[" + name + "]]";
var proxy = revocable.proxy;
console.log(; // "[[foo]]"


console.log(; // TypeError is thrown = 1           // TypeError again
delete;       // still TypeError
typeof proxy            // "object", typeof doesn't trigger any trap


Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Proxy Revocation Functions' in that specification.
Standard Initial definition.
ECMAScript Latest Draft (ECMA-262)
The definition of 'Proxy Revocation Functions' in that specification.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
revocableChrome Full support 63Edge Full support 12Firefox Full support 34IE No support NoOpera Full support YesSafari Full support 10WebView Android Full support 63Chrome Android Full support 63Firefox Android Full support 34Opera Android Full support YesSafari iOS Full support 10Samsung Internet Android Full support 8.0nodejs Full support 6.0.0


Full support  
Full support
No support  
No support

See also