You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
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.
Syntax
obj.unwatch(prop)
Parameters
prop- The name of a property of the object to stop watching.
Return value
Description
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.
Examples
See watch().
Specifications
Not part of any specifications. Implemented in JavaScript 1.2.
Browser compatibility
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unwatch | Chrome No support No | Edge No support No | Firefox No support 1 — 58 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support 4 — 58 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No | nodejs No support No |
Legend
- No support
- No support
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.
Compatibility notes
- Calling
unwatch()on theDocumentobject throws aTypeErrorsince Firefox 23 (bug 903332). This regression has been fixed with Firefox 27.