Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #19334

Re: Stripping [ ] from JSON arrays

X-Received by 2002:a05:622a:4d:b0:3bb:902e:44a2 with SMTP id y13-20020a05622a004d00b003bb902e44a2mr521254qtw.57.1676551850564; Thu, 16 Feb 2023 04:50:50 -0800 (PST)
X-Received by 2002:a25:9f82:0:b0:8ff:c39e:af34 with SMTP id u2-20020a259f82000000b008ffc39eaf34mr572373ybq.280.1676551850131; Thu, 16 Feb 2023 04:50:50 -0800 (PST)
Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups comp.lang.php
Date Thu, 16 Feb 2023 04:50:49 -0800 (PST)
In-Reply-To <1rb3ua6kn88tn.objz7l6azwbd.dlg@40tude.net>
Injection-Info google-groups.googlegroups.com; posting-host=82.131.79.206; posting-account=HfIszAoAAAC8ch6q3uChpTWUALHCfEoF
NNTP-Posting-Host 82.131.79.206
References <tpiebr$cso$64@gallifrey.nk.ca> <1rb3ua6kn88tn.objz7l6azwbd.dlg@40tude.net>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <79d2b4cc-e6c0-436e-ac98-e8cdfaeaf004n@googlegroups.com> (permalink)
Subject Re: Stripping [ ] from JSON arrays
From Y A <y000000000000@ya.ee>
Injection-Date Thu, 16 Feb 2023 12:50:50 +0000
Content-Type text/plain; charset="UTF-8"
Lines 11
Xref csiph.com comp.lang.php:19334

Show key headers only | View raw


You have looked out: http://webchatsoftware.ezyro.com ?




On Tuesday, January 10, 2023 at 6:29:21 AM UTC+2, JJ wrote:
> On Tue, 10 Jan 2023 01:17:47 -0000 (UTC), The Doctor wrote: 
> > 
> > How do I strip unnecessary [] ?
> I'd use array's `reduce()` for that. e.g. 
> 
> var resultObj = theArray.reduce((res, obj) => Object.assign(res, obj), {});

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Stripping [ ] from JSON arrays doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-01-10 01:17 +0000
  Re: Stripping [ ] from JSON arrays JJ <jj4public@outlook.com> - 2023-01-10 11:29 +0700
    Re: Stripping [ ] from JSON arrays Elhwen Dico <elhwen.dicote@gmail.com> - 2023-01-11 17:09 +0100
      Re: Stripping [ ] from JSON arrays doctor@doctor.nl2k.ab.ca (The Doctor) - 2023-01-11 16:18 +0000
    Re: Stripping [ ] from JSON arrays Y A <y000000000000@ya.ee> - 2023-02-16 04:50 -0800
  Re: Stripping [ ] from JSON arrays Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2023-01-10 08:10 +0000
    Re: Stripping [ ] from JSON arrays Y A <y000000000000@ya.ee> - 2023-02-16 04:51 -0800

csiph-web