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


Groups > comp.lang.javascript > #35957

Re: let and {}

Path csiph.com!aioe.org!.POSTED!not-for-mail
From Luca <luca@please.nospam.it>
Newsgroups comp.lang.javascript
Subject Re: let and {}
Date Thu, 3 Jan 2019 23:45:24 -0500
Organization Aioe.org NNTP Server
Lines 18
Message-ID <q0mod5$4nm$1@gioia.aioe.org> (permalink)
References <q0lao9$1vie$1@gioia.aioe.org> <slrnq2se7a.1f4.jon+usenet@sable.unequivocal.eu> <q0ljc3$17ip$1@gioia.aioe.org> <slrnq2sqsh.1f4.jon+usenet@sable.unequivocal.eu>
NNTP-Posting-Host 9gnqpp9oYuAR7lpMUE+img.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3
X-Notice Filtered by postfilter v. 0.8.3
Content-Language en-US
Xref csiph.com comp.lang.javascript:35957

Show key headers only | View raw


Thank you very much, Jon. Very instructive

On 1/3/2019 3:07 PM, Jon Ribbens wrote:

> Oh, yes. This is a special abbreviated syntax they added that does
> rely on the assumption that the name of the variable matches the
> object property you are trying to access. This is often a reasonable
> assumption so it's a useful shortcut.
> 
> You can actually get it to work if the name does not match, but it's
> a bit more verbose:
> 
>      let { wrongGuesses: wrongGuesses2, correctGuesses } = this.state
> 
> i.e. 'object property name' : 'variable name'.
> 

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


Thread

let and {} Luca <luca@please.nospam.it> - 2019-01-03 10:46 -0500
  Re: let and {} Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-01-03 16:31 +0000
    Re: let and {} Luca <please_no@spam.it> - 2019-01-03 13:13 -0500
      Re: let and {} Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-01-03 20:07 +0000
        Re: let and {} Luca <luca@please.nospam.it> - 2019-01-03 23:45 -0500
  Re: let and {} Martin Honnen <martin.honnen@gmx.de> - 2019-01-03 17:32 +0100
    Re: let and {} Luca <please_no@spam.it> - 2019-01-03 13:14 -0500

csiph-web