Object.unwatch()

JavaScript 1.2+ Nav4+, NES3+ Syntax

							object.unwatch(prop)

Description

The unwatch() method of the Object object allows you to remove a watchpoint set on a property with the watch() method. This method takes a the property, prop, as a parameter.

Example

Listing 6.197 shows how the unwatch() object is used. A temporary variable, tmp, is created and initialized. It is then set to be watched by invoking the watch method. If any changes occur to the tmp variable, the inform function is called. After a change is made to the variable, unwatch is called to turn off watch operations on the variable. Once watch operations are disabled, the variable can be changed without notification.

Listing 6.197 Example of unwatch() Method ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.