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: <1rb3ua6kn88tn.objz7l6azwbd.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <79d2b4cc-e6c0-436e-ac98-e8cdfaeaf004n@googlegroups.com> Subject: Re: Stripping [ ] from JSON arrays From: Y A 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 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), {});