Subj : JavaScript: How can I add getter/setter to constructed object? To : netscape.public.mozilla.jseng From : Lev Serebryakov Date : Mon Apr 18 2005 01:05 pm If I need to add method to constructed object, it is easy: ========================= var o = new Object(); o.method = function( param ) { ... }; o.method( "Yeah!" ); ========================= If I need to add gettr/setter to prototype it is easy too: ========================= function MyObj() {} MyObj.prototype = { get myProp() { return 1; }, set myProp( val ) { } } ========================= How could I add getter/setter to EXISTING object? Lev Serebryakov Programmer JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!" Posted by JetBrains Omea Pro 561.11 .