Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #38404
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2020-05-12 07:59 -0700 |
| References | <C9udnTlJHfCQbSnDnZ2dnUU7-U3NnZ2d@westnet.com.au> <2530230.mvXUDI8C0e@PointedEars.de> <bd26a96b-d081-4dcb-9e42-9f7c4e544cb4@googlegroups.com> |
| Message-ID | <2830b2bf-118d-4e60-beae-c562a07d1f8c@googlegroups.com> (permalink) |
| Subject | Re: check for obj nested prop |
| From | luserdroog <luser.droog@gmail.com> |
On Tuesday, May 12, 2020 at 6:04:49 AM UTC-5, Julio Di Egidio wrote:
> On Saturday, 9 May 2020 00:19:22 UTC+2, Thomas 'PointedEars' Lahn wrote:
> > Andrew Poulos wrote:
> >
> > > Is there a way to get the check value of an object's nested property
> > > without first having to test for all the ascendant properties?
> >
> > No. Therefore I had written jsx.object.getFeature(). It has the advantage
> > over the approach presented by “JJ” that it also supports property names
> > that contain a “.”. It basically differs from their approach in that you
> > (can) pass multiple String values as arguments instead of a single String
> > value. (I had the one-string approach first, but ran into problems with “.”
> > in property names.)
> >
> > It can be used like this:
> >
> > if (_getFeature(a, 'b', 'c', 'd')) {
> > // …
> > }
> >
> > <https://github.com/PointedEars/JSX/blob/master/object.js#L970>
>
> Another "clever" solution that is highly advised against except for special
> situations: in general, hard-coding strings in place of static code is another
> no no...
Do you have a list of all the no no-s? I probably do a bunch.
Single-letter variables?
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
check for obj nested prop Andrew Poulos <ap_prog@hotmail.com> - 2020-05-08 15:37 +1000
Re: check for obj nested prop Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-05-08 10:52 +0100
Re: check for obj nested prop Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-05-09 00:26 +0200
Re: check for obj nested prop Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-05-09 03:09 +0100
Re: check for obj nested prop Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-05-12 09:28 +0200
Re: check for obj nested prop Julio Di Egidio <julio@diegidio.name> - 2020-05-12 04:01 -0700
Exception handling (was: check for obj nested prop) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-05-09 03:46 +0200
Re: check for obj nested prop JJ <jj4public@vfemail.net> - 2020-05-08 17:18 +0700
Re: check for obj nested prop Julio Di Egidio <julio@diegidio.name> - 2020-05-08 03:53 -0700
Re: check for obj nested prop James Kirk <noneya.invalid@gmail.com> - 2020-05-08 11:00 -0400
Re: check for obj nested prop Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-05-09 00:19 +0200
Re: check for obj nested prop Julio Di Egidio <julio@diegidio.name> - 2020-05-12 04:04 -0700
Re: check for obj nested prop luserdroog <luser.droog@gmail.com> - 2020-05-12 07:59 -0700
Re: check for obj nested prop "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-05-12 14:17 -0700
Re: check for obj nested prop Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-05-13 02:46 +0200
Re: check for obj nested prop Andrew Poulos <ap_prog@hotmail.com> - 2020-05-13 13:08 +1000
Re: check for obj nested prop "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-05-13 12:30 -0700
csiph-web