quote:
Originally posted by MrPickle
Just for example, say that oChatWnd.Handle is 1054, when you do this: oChatWnds[oChatWnd.Handle], it's looking at the 1054th address, what happened to the other 1053? Isn't this going to waste a huge amount of memory?
So what I'm basically asking is, will JavaScript initialize all of the array's adresses, 0 - 1054, and leave any unused empty, or will it simply move 1054 to whatever's the next available slot and then create a pointer in the previous address to the new address?
JScript uses sparse arrays...
jscript code:
for(var s in oChatWnds){
Debug.Trace(oChatWnds[s])
}
will only display 1054... it will not loop through all of them. It wouldn't really be a speed issue that you'd notice if it wasn't this way tbh.
EDIT:
quote:
Originally posted by Spunky
what happened to the other 1053?
You mean 1054; JScript arrays are zero-based