Subj : Re: Mulit dimensional arrays To : Andreas Podgurski From : Brendan Eich Date : Tue Mar 02 2004 02:06 pm Andreas Podgurski wrote: > I think he wants to know, whether he may call JS_GetProperty directly > on [0][1] to read the value=12 in C or if it works differently. I > would think that calling JS_GetProperty on lMatrix would result in > returing a proxy object, referencing to the second dimension, which > has to be accessed with another JS_GetProperty on that proxy. Am I > wrong with it? I'm looking forward this problem, too, and it would be > nice, if someone could comment on this... Yes, each "row" in the matrix needs its own object. Every use of [] to access a property must have an object as its left operand. Just as a.b.c requires a and b to convert to objec type, so a[i][j] requires a and a[i] to be objects, or convert to object type in useful (persistent) ways. Don't get hung up on the [] syntax. It's just a generalization of the . syntax. For a.b, b must be a lexical identifier. For any other property name, you can say a['@%$#b'], e.g. /be .