This has been discussed ad nauseum, in this thread <https://esdiscuss.org/topic/extended-dot-notation-pick-notation-proposal> and elsewhere. Some people call this "picking", or "deconstructing into objects". There seems to be little appetite for taking it up, in spite of it being (IMHO) a very common use case.
Bob On Fri, Mar 17, 2017 at 7:09 AM, Felipe Nascimento de Moura < [email protected]> wrote: > Hi. > I am trying to get an object out of another object, with only a few of its > properties. > > I know we can do this: > > let { a, c } = { a: 1, b: 2, c: 3 } > > In this case, we have a variable 'a' and a variable 'c'. > What I want is { a: 1, c: 3} > > Is there a way to do it? Something like: > > let { a, c } as X = { a: 1, b: 2, c: 3 } > > and then, have the variable X with an object { a: 1, c: 3} > > Is there a way to do that? If now...would it make sense to become a > proposal? > > Thanks. > > [ ]s > > *--* > > *Felipe N. Moura* > Web Developer, Google Developer Expert > <https://developers.google.com/experts/people/felipe-moura>, Founder of > BrazilJS <https://braziljs.org/> and Nasc <http://nasc.io/>. > > Website: http://felipenmoura.com / http://nasc.io/ > Twitter: @felipenmoura <http://twitter.com/felipenmoura> > Facebook: http://fb.com/felipenmoura > LinkedIn: http://goo.gl/qGmq > --------------------------------- > *Changing the world* is the least I expect from myself! > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

