Skip to content

Commit

Permalink
Confirmed to keep non-existent properties
Browse files Browse the repository at this point in the history
  • Loading branch information
aleen42 committed May 29, 2023
1 parent 07813b0 commit 54ea30c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,11 @@ Object.pick({a : 1, b : 2}, (v, k) => k !== 'b'); // => {a: 1}
({a : 1, b : 2, c : 3}).{a, b : B}; // => {a: 1, B: 2}
```

Currently, there is a disagreement on whether properties with default assignment values should be picked.
~~Currently, there is a disagreement on whether properties with default assignment values should be picked.~~ It has been reviewed in [#6](https://github.com/tc39-transfer/proposal-object-pick-or-omit/pull/6) which confirmed that the `.{...}` statement should denote what the new object should contain like restructuring:

```js
// If considering the meaning of picking, the initial value has no meanings
({a : 1, b : 2, c : 3}).{a, d = 2}; // => {a: 1}
// If considering as "restructuring", the shortcut has its reason to pick
({a : 1, b : 2, c : 3}).{a, d = 2}; // => {a: 1, d: 2}
({a : 1, b : 2, c : 3, d : 4}).{a, d = 2}; // => {a: 1, d: 4}
```

Nevertheless, it is just a simple vision, and feel free to discuss it.
Expand Down

0 comments on commit 54ea30c

Please sign in to comment.