Subj : Re: SeaMonkey: Global properties To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Thu Mar 06 2003 02:59 pm Anatoly Kochergin wrote: > Thank you for response. > > As I understand in the first line ("a=1") a temporary object has been > created and then disposed. As a result we get "a" global variable of > Number type. It is an object - so we can do "a.a=1". But "a.a" - is not > an object. The variable a does not contain a Number object but a number value. The element lookup operator used in the expression a.a causes the value read from a to be automatically casted to a temporary Number object. a.a=1 asigns the 1 to a property a of that temporary Number object. After that expression this temporary Number object is discarded. This causes a.a in a new expression to create a new temporary Number objct, where the property a is undefined. .