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


Groups > comp.lang.javascript > #30173

Re: convert a string into a json object,

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: convert a string into a json object,
Date Fri, 01 Apr 2016 20:36:12 +0100
Organization A noiseless patient Spider
Lines 27
Message-ID <87d1q9qfyr.fsf@bsb.me.uk> (permalink)
References <c8134afb-b7f5-4e2d-b3e6-90f8a3594544@googlegroups.com> <json-20160401033220@ram.dialup.fu-berlin.de> <ndlcms$ae5$1@news.albasani.net> <style-20160401174212@ram.dialup.fu-berlin.de> <i0ftfbt8uvgeeg9nsn9hqk8496tmn647pp@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="24595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZRyKDzKh9nfuksCBd/K1pj6aaIBQE5Ic="
Cancel-Lock sha1:HSXN2Mi6bAIu+KaTT/U0scwXvSs= sha1:Y8KnxJJwoRVuRk/uI77Gu3IlET0=
X-BSB-Auth 1.1d4a89994de7d76f876e.20160401203612BST.87d1q9qfyr.fsf@bsb.me.uk
Xref csiph.com comp.lang.javascript:30173

Show key headers only | View raw


John Harris <niam@jghnorth.org.uk.invalid> writes:

> On 1 Apr 2016 16:45:59 GMT, ram@zedat.fu-berlin.de (Stefan Ram) wrote:
>
>>Stefan Weiss <krewecherl@gmail.com> writes:  
>   <snip>
>>>Off-topic... does anymody else find it counter-intuitive when most of the
>>>variables are declared as "const"? I've seen this style recently in many
>>>places, and it's technically correct, but for some reason I find it irritating.
>>
>>  These /are/ constants because they are not assigned to after
>>  their initializations. I deem it most readable to declare
>>  constants with »const« and not with »let«. Because it /is/
>>  a constant, it also should be /declared/ to be a constant.
>
> The code contained
>   const result = {};
> and
>   result[i]= person;
>
> The constant  result  is not what I would call a constant. You've
> updated it.

const makes the binding immutable, the object isn't.

-- 
Ben.

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


Thread

convert a string into a json object, JRough <janis.rough@gmail.com> - 2016-03-31 19:12 -0700
  Re: convert a string into a json object, Stefan Weiss <krewecherl@gmail.com> - 2016-04-01 10:42 +0200
    Re: convert a string into a json object, JRough <janis.rough@gmail.com> - 2016-04-01 17:32 -0700
  Re: convert a string into a json object, Stefan Weiss <krewecherl@gmail.com> - 2016-04-01 10:49 +0200
    Re: convert a string into a json object, John Harris <niam@jghnorth.org.uk.invalid> - 2016-04-01 19:21 +0100
      Re: convert a string into a json object, Aleksandro <aleksandro@gmx.com> - 2016-04-01 16:21 -0300
      Re: convert a string into a json object, Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-04-01 20:36 +0100
        Re: convert a string into a json object, Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-04-02 04:07 +0200
          Re: convert a string into a json object, Aleksandro <aleksandro@gmx.com> - 2016-04-02 12:07 -0300
            Re: convert a string into a json object, Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-04-02 17:36 +0200
              Re: convert a string into a json object, Aleksandro <aleksandro@gmx.com> - 2016-04-02 21:01 -0300
          Re: convert a string into a json object, Scott Sauyet <scott@sauyet.com> - 2016-04-02 20:40 +0000
    Re: convert a string into a json object, Stefan Weiss <krewecherl@gmail.com> - 2016-04-02 01:18 +0200
      Re: convert a string into a json object, John Harris <niam@jghnorth.org.uk.invalid> - 2016-04-02 11:29 +0100
    Re: convert a string into a json object, Scott Sauyet <scott@sauyet.com> - 2016-04-02 20:30 +0000
  Re: convert a string into a json object, JRough <janis.rough@gmail.com> - 2016-04-01 11:32 -0700
    Re: convert a string into a json object, Stefan Weiss <krewecherl@gmail.com> - 2016-04-02 00:51 +0200
      Re: convert a string into a json object, Aleksandro <aleksandro@gmx.com> - 2016-04-02 12:03 -0300
  Re: convert a string into a json object, Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-04-02 03:48 +0200
  Re: convert a string into a json object, Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-04-02 04:25 +0200

csiph-web