Bob Myers (2016-09-15T16:58:19.000Z)
rtm at gol.com (2016-09-21T22:18:19.116Z)
Since some people seem to find the proposed pick notation `o.{p1, p2}`, (to create an object composed of the `p1` and `p2` properties from `o`) confusing, I am making an alternative proposal which hews more closely to existing deconstructing assignment. The definition of the new syntax is: > If a deconstructing assignment is wrapped in curly brackets `{}`, the result is a new object where the deconstructed names and values become property names and values. The above case would be written as: ``` { {p1, p2} = o } ``` and would result in ``` { p1: o.p1, p2: o.p2 } ``` AFAICT the above syntax should be uniquely parseable. The advantage of this syntax is the minimal cognitive footprint: if you know how to deconstruct an object into variables using deconstructing assignment, then you can deconstruct an object into properties on a new object with nothing more than an extra set of surrounding curlies. I will be adding this alternative syntax to the repo here <https://github.com/rtm/js-pick-notation> and here <https://github.com/rtm/js-pick-notation/blob/master/minimal/spec.md> in the near future. -- Bob