Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #37762
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: End of selected items. |
| Date | 2019-11-12 15:31 +0100 |
| Message-ID | <h2vu26Fr5esU1@mid.individual.net> (permalink) |
| References | <64be7dde-48ce-4a0a-8ae7-32ecbd9d1399@googlegroups.com> |
On 11.11.19 11:52, Jonas Thörnvall wrote: > An array can hold elements with different types, there is no problem to step thru all elements of an array. > > But how do one handle stepping thru an array where you do not know the last element of a certain type? > > What is the condition for the increment->, that tells this was the last element? You step thru the whole array and just use the element if it is of a certain type and ignore the others. > You can't tell it was the last element until end of array? Should one just scroll thru and find last element index of each type and save at beginning? Yes. > I guess that must be done but am not sure, this problem must come up in every database? In a database one would just not query element types you don't want. For example with an SQL query: select * from articles where location='bookshelf' and NOT: "select * from articles" followed by a script which goes thru the result just to find the last article with the condition "location=='bookshelf'". -- Arno Welzel https://arnowelzel.de
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
End of selected items. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-11 02:52 -0800
Re: End of selected items. John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-11 11:22 +0000
Re: End of selected items. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-11 05:58 -0800
Re: End of selected items. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 15:31 +0100
Re: End of selected items. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-11-12 15:46 +0100
csiph-web