Path: csiph.com!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: convert a string into a json object, Date: Sat, 02 Apr 2016 04:25:37 +0200 Organization: PointedEars Software (PES) Lines: 21 Message-ID: <2854466.X3ZI4lkZKL@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: solani.org 1459563938 31480 eJwFwQERADEIAzBLzygF5EB38y/hk3AalWAQ8eKZKu4edZc064uuj8zAdDYl3oKfVNc82P4cHRDu (2 Apr 2016 02:25:38 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sat, 2 Apr 2016 02:25:38 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNycEBwCAIA8CVRAjIOIhk/xHa+x7UxTvM4QaCq7eyRLTvNJWb3idecBQy5ZI5hvhzXZ3aLyNjo8pwOI4Pc5MWLQ== Cancel-Lock: sha1:rX2Lt8mM15jkgtZBBE/+tAMpKRk= X-NNTP-Posting-Host: eJwNyskBwDAIA7CV6gZMGIdz/xFavaWHYJlQKbq6N9NCAOvSMUQLMbNXnN2e3Kl4t/z557mODy8hEdU= Xref: csiph.com comp.lang.javascript:30183 Stefan Ram wrote: > { const record = row[ i ].split( "_" ); > const person = {}; > person.name = record[ 0 ]; > person.city = record[ 1 ]; > person.job = record[ 2 ]; Destructuring assignment: [person.name, person.city, person.job] = record; -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.