Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #36678
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2019-05-30 11:10 -0700 |
| References | (3 earlier) <84fe9111-5bab-4537-8d08-424ec56763d7@googlegroups.com> <87h89elg1u.fsf@bsb.me.uk> <5255243.DvuYhMxLoT@PointedEars.de> <5066794d-b841-42dd-8284-481f2de163f3@googlegroups.com> <90e7fbb5-80b4-4090-96dd-3ce21cb0d84a@googlegroups.com> |
| Message-ID | <381f7001-cf26-4c20-bb40-bbfa3af2666a@googlegroups.com> (permalink) |
| Subject | Re: Create array using name from string? |
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
Den onsdag 29 maj 2019 kl. 19:10:42 UTC+2 skrev Julio Di Egidio:
> On Wednesday, 29 May 2019 09:07:10 UTC+2, Jonas Thörnvall wrote:
>
> > I think you all missunderstood the question it is about generate,
> > variables dynamically and give them the name of string content.
>
> Which is an awful idea, as others were saying, and just means you (and
> whomever is seconding you with that eval) have no idea how JS works.
>
> Rather note that in JS objects already are essentially dictionaries, i.e.
> with arbitrary key names, so what you might do is:
>
> var data = {};
> data[NAME1] = ...;
> data[NAME2] = ...;
>
> Where NAME1, etc. are the names you get by splitting (string split) the
> input string. -- For all I could gather from your blathering...
>
> HTH,
>
> Julio
Well i skipped the idea of somekind of object all together, first i split out the banks from document, then i split banks into an array "each element holding a bank", then i read out the bankname "first line" and after that i split each bank into an instrument array creating the option lists to select bank and instrument using innerHTML.
The downside is i have to split and read in instruments everytime i change bank. The upside? i do not have to have all banks in memory or as an object. Well in i a way i have each bank is an array element, splitted again and again and again at bank change... Maybe not ideal but bankchange hardly a time critical event.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-28 02:06 -0700
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-28 02:11 -0700
Re: Create array using name from string? "R.Wieser" <address@not.available> - 2019-05-28 11:39 +0200
Re: Create array using name from string? "R.Wieser" <address@not.available> - 2019-05-28 12:02 +0200
Re: Create array using name from string? dr.j.r.stockton@gmail.com - 2019-05-28 05:38 -0700
Re: Create array using name from string? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-05-28 17:06 +0100
Re: Create array using name from string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-05-29 00:22 +0200
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-29 00:07 -0700
Re: Create array using name from string? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-05-29 09:47 +0200
Re: Create array using name from string? Julio Di Egidio <julio@diegidio.name> - 2019-05-29 10:10 -0700
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-30 11:10 -0700
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-30 11:12 -0700
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-30 11:22 -0700
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-30 11:28 -0700
Re: Create array using name from string? Julio Di Egidio <julio@diegidio.name> - 2019-05-29 10:24 -0700
Re: Create array using name from string? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2019-05-30 11:37 +0200
Re: Create array using name from string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-05-30 12:35 +0200
Re: Create array using name from string? Julio Di Egidio <julio@diegidio.name> - 2019-05-30 03:43 -0700
Re: Create array using name from string? Julio Di Egidio <julio@diegidio.name> - 2019-05-30 03:48 -0700
Re: Create array using name from string? Gene Wirchenko <genew@telus.net> - 2019-05-30 12:13 -0700
Re: Create array using name from string? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-05-30 10:34 -0700
Re: Create array using name from string? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-31 19:01 +0100
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-31 11:21 -0700
Re: Create array using name from string? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-06-01 00:31 +0200
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-01 00:40 -0700
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-06-01 01:10 -0700
Re: Create array using name from string? John G Harris <niam@jghnorth.org.uk.invalid> - 2019-06-01 10:14 +0100
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-29 00:15 -0700
Re: Create array using name from string? "R.Wieser" <address@not.available> - 2019-05-29 09:35 +0200
Re: Create array using name from string? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-05-29 01:16 -0700
csiph-web