From: Robert R. <rra...@ya...> - 2000-11-05 20:33:02
|
Why not just store the count and have just an allID. In what cases do you need to access the array by its .all array? You can still loop through the allID array, but it wouldn't be necessary as much as it is now. \\Robert -- > The original idea behind the two array was to have a flexible way to > reference DynLayers and to provide a proper toString method so you can do > away with the eval(this.obj + "=this") trick. > > all: > > - allows you to check for the number of DynLayers with the .length property > - best when used with for (var i=0;i<all.length;i++) type loop > - useful if you ever need an ordinal reference > > alID: > > - allows an instant check by ID (no loop needed) > - best when used with for (var i in all) type loop > - easy array element deletion: delete allID[obj.id] > - used to return a consistent string reference: > DynAPI.getDocument(id).allID[id] > > I agree it can be a pain to manage the two arrays. |