Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] [Javascript] Shouldn't there be a sort option on objects
- Date: Sun, 06 Feb 2011 23:16:55 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: [tlug] [Javascript] Shouldn't there be a sort option on objects
- References: <4D4E75AB.5060703@example.com>
No. In all languages where I know anything about objects, they have named attributes which are in principle unordered (typically implemented as a hash table or association list). If you want an object with ordered attributes, give it an attribute which contains an array of the data you want to sort. > For more specifics, my object looks like this > > toplevel.midlevel.dataIWantToSortBy > > "midlevel" is just a number that I use to order the data when I display > it. Why does toplevel need to be an object? Why not make it an array directly? That is even if toplevel *is* an object, why not do the sorting in an auxiliary array?
- Follow-Ups:
- References:
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Great Git resources -- thanks!
- Next by Date: Re: [tlug] Symbol#taguri= in Ruby
- Previous by thread: [tlug] [Javascript] Shouldn't there be a sort option on objects
- Next by thread: Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links