Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.mb-net.net!open-news-network.org!.POSTED.44.235.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: using Map Was: Re: get set value in array of objects Date: Wed, 13 Jun 2018 23:32:57 +0200 Organization: PointedEars Software (PES) Lines: 21 Message-ID: <2513390.l9jetEAcx8@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Info: gwaiyur.mb-net.net; posting-host="44.235.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch:178.197.235.44"; logging-data="10774"; mail-complaints-to="abuse@open-news-network.org" User-Agent: KNode/4.14.2 X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. On 13/06/2018 2:43 PM, Andrew Poulos wrote: >> objArray.get(3).name = 'Contrary'; > > The only problem being that if the 'name' property doesn't exist it > throws an error […] A “TypeError” exception will be thrown then only if the item is sealed (not extensible, see Object.seal()) and it is strict mode code. Otherwise either nothing happens (sealed, non-strict), or the property will be created on the item (not sealed). Another possibility is that the item is a Proxy instance with a setter that prevents the addition of properties to its target, in which case the behavior is either implementation-defined or user-defined. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.