On May 27, 11:42 pm, Martin Honnen <[email protected]> wrote: > Bj rn S derqvist wrote: > > I managed to make a function which seems to work. > > But basically you're saying that even if the following code seems to > > work in my browser, I shouldn't rely on it to work? > > To give you an example, with IE 9 and browser modus being "IE9" and > document modus being "IE9-Standards" the snippet > > var obj = {a:1, c:3, b:2, 4: 4}; > var propNames = []; > for (var propName in obj) { > propNames.push(propName);} > > propNames.join('\n') > > yields > > 4 > a > c > b
In IE 6 and Firefox: a c b 4 More fun: delete obj.c; obj.c = 3; Gives in IE 6: a c b 4 But in Firefox: a b 4 c Hours of innocent boredom. :-) -- Rob -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
