Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #11434
| Content-Type | text/plain; charset="UTF-8" |
|---|---|
| Message-ID | <1936201.aqSPkdTlGX@PointedEars.de> (permalink) |
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Organization | PointedEars Software (PES) |
| Date | Tue, 07 Feb 2012 13:15:36 +0100 |
| User-Agent | KNode/4.4.11 |
| Content-Transfer-Encoding | 8Bit |
| Subject | Re: help coding a hash table |
| Newsgroups | comp.lang.javascript |
| References | <5cd32919-6fdd-4b39-b452-e138e0949107@lr19g2000pbb.googlegroups.com> <4f310138$0$6915$e4fe514c@news2.news.xs4all.nl> |
| Followup-To | comp.lang.javascript |
| MIME-Version | 1.0 |
| Lines | 31 |
| NNTP-Posting-Date | 07 Feb 2012 13:15:36 CET |
| NNTP-Posting-Host | 41b6fca1.newsspool4.arcor-online.net |
| X-Trace | DXC=JR<?LOMVSP6U`5g[@c]@J14IUK<Cl32<14Fo<]lROoR18kF<OcfhCO;Lf0HJ8I\J]>DZm8W4\YJN<b@mF9jNikd5lYEA^Z8=X`0>9=nMG<EUm6 |
| X-Complaints-To | usenet-abuse@arcor.de |
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.javascript:11434 |
Followups directed to: comp.lang.javascript
Show key headers only | View raw
Erwin Moller wrote: > On 2/7/2012 2:08 AM, JRough wrote: >> How do I create a javascript associative array […] > > […] > About associative: If you create an empty object, just can add > "properties" with values to it to your heart's liking. That way you have > your associative array behaviour. > > var myTime = new Object(); > myTime.firstName = "J."; > myTime.famName = "Rough"; However, by default there are no empty objects (although there are proprietary ways like assigning to the `__proto__' property to create them, leaving a from then on crippled object). Even Object instances inherit from Object.prototype by default. As a result, some property names (like "toString") are already used. So you should avoid assigning to the corresponding properties in order to store user data. Which points out *again* _that there are no *built-in* associative arrays in ECMAScript implementations_ (but you can try to emulate them, like with jsx.map.Map [1]). PointedEars ___________ [1] <http://PointedEars.de/scripts/map.js> -- When all you know is jQuery, every problem looks $(olvable).
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
help coding a hash table JRough <janis.rough@gmail.com> - 2012-02-06 17:08 -0800
Re: help coding a hash table Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-02-07 11:47 +0100
Re: help coding a hash table Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-07 13:15 +0100
csiph-web