Deprecation warning: Do not use unwatch()
and watch()
! These two methods were implemented only in Firefox prior to version 58, they're deprecated and removed in Firefox 58+. In addition, using watchpoints has a serious negative impact on performance, which is especially true when used on global objects, such as window
. You can usually use setters and getters or proxies instead.
The unwatch()
method removes a watchpoint set with the watch()
method.
obj.unwatch(prop)
prop
The JavaScript debugger has functionality similar to that provided by this method, as well as other debugging options. For information on the debugger, see Venkman.
By default, this method is inherited by every object descended from Object
.
Note: The reason for unwatch()
to take the property name prop as its only parameter is due to the "single handler allowing" behavior of the watch()
method.
See watch()
.
Not part of any specifications. Implemented in JavaScript 1.2.
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | No | No | 1 — 58 | No | No | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | No | No | No | 4 — 58 | No | No | No |
Server | |
---|---|
Node.js | |
Basic support | No |
unwatch()
on the Document
object throws a TypeError
since Firefox 23 (bug 903332). This regression has been fixed with Firefox 27.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/unwatch