Sie lesen die englische Version dieses Inhalts, da für dieses Gebietsschema noch keine Übersetzung vorhanden ist. Helfen Sie uns, diesen Artikel zu übersetzen!

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The Object.unobserve() method was used to remove observers set by Object.observe(), but has been deprecated and removed from Browsers. You can use the more general Proxy object instead.


Object.unobserve(obj, callback)


The object to stop observing.
The reference to the observer to stop calling each time changes are made on the object obj.

Return value

The specified object.


Object.unobserve() should be called after Object.observe() in order to remove an observer from an object.

The callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer. It's useless to call Object.unobserve() with an anonymous function as callback, it will not remove any observer.


Unobserving an object

var obj = {
  foo: 0,
  bar: 1

var observer = function(changes) {

Object.observe(obj, observer);
obj.newProperty = 2;
// [{name: 'newProperty', object: <obj>, type: 'add'}]

Object.unobserve(obj, observer);

obj.foo = 1;
// The callback wasn't called

Using an anonymous function

var person = {
  name: 'Ahmed',
  age: 25

Object.observe(person, function(changes) {

person.age = 40; 
// [{name: 'age', object: <obj>, oldValue: 25, type: 'update'}]

Object.unobserve(person, function(changes) {

person.age = 63;
// [{name: 'age', object: <obj>, oldValue: 40, type: 'update'}]
// The callback will always be called


Strawman proposal specification.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
Chrome No support 36 — 52Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support Nonodejs No support No


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.

See also