Question ... perhaps a proposal: extract from object to object

Felipe Nascimento de Moura felipenmoura at
Fri Mar 17 01:39:13 UTC 2017

I am trying to get an object out of another object, with only a few of its

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


[ ]s


*Felipe N. Moura*
Web Developer, Google Developer Expert
<>, Founder of
BrazilJS <> and Nasc <>.

Website: /
Twitter:    @felipenmoura <>
*Changing  the  world*  is the least I expect from  myself!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list