You can use scripting to add properties to the prototypes of some of these static objects. To do so, you must use new features added to NN6. Two new methods— __defineGetter__() and __defineSetter__()—enable you to assign functions to a custom property of an object.
The functions execute whenever the property is read (the function assigned via
the __defineGetter__() method) or modified (the function assigned via the
__defineSetter__() method). The common way to define these functions is in
the form of an anonymous function. The formats for the two statements
that assign these behaviors to an object prototype are as follows: