Export: looping over creators in order

This is a really basic question but I want to be sure I have it right since I am not experienced with javascript.

I want to loop over the creators of an item and process each creator, preserving the order of authors/editors/etc. Can a "for c in item.creators" loop be used for this or do I have to use an indexed array loop? I.e. will for...in always preserve order? I think it will because it's looping over properties of an object, right?

Thanks.
  • The order should be preserved either way, although using an indexed array is slightly safer, since the properties could included unexpected ones if, say, Object has been extended. In general, though, direct questions like this to zotero-dev, the developers' listserv (http://groups.google.com/group/zotero-dev).
  • Object should never be extended within privileged code. We use 'for' in core Zotero code, and it hasn't been a problem in years.

    But yes, post to the dev list with further questions like this.

This is an old discussion that has not been active in a long time. Instead of commenting here, you should start a new discussion. If you think the content of this discussion is still relevant, you can link to it from your new discussion.