Bob Myers
1 min readSep 4, 2018

--

Good post about this useful technique. However, the underlying issue is why the JavaScript language designers do not seem to care about object manipulation, which is something real programmers do every day, and instead spend their time thinking about arcane features. We still do not have a simple way to take two properties from one object and put them in another object (“picking”). We cannot do something as simple as {other.prop}, which should place the property named prop from other into the object being defined, under the name prop.

This is not for lack of proposals. There have been plenty of those. What has been missing is any level of interest. I really don’t think the TC39 guys are actual users of the language. They’ve been off building engines in C++ for too long, and forgotten what it’s like to actually write JavaScript.

There have been a couple proposals made for picking. In one, you would say a.{b, c} to create the object {b: a.b, c: a.c}. It seems like an obvious, useful extension of a.b. It’s certainly no less handy, and considerably more obvious, than destructuring. Yet there has been no interest whatsoever about this feature, despite extensive discussions in the relevant forums, such as es-discuss.

--

--

Bob Myers
Bob Myers

Written by Bob Myers

Technologist, writer, Japanologist

Responses (2)