Skip to content

Commit

Permalink
Merge pull request tc39#44 from svincent/patch-1
Browse files Browse the repository at this point in the history
Make tc39#17 a link
  • Loading branch information
bterlson authored Jul 21, 2017
2 parents e9ea4c7 + b7f100a commit a0ec829
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ LiteralMatchPattern :
// number, string, boolean, null, or undefined literal
```

The syntax of object and array patterns deliberately hews closely to destructuring which is advantageous for a couple reasons. First, it aligns with existing syntax that developers are familiar with. Second, it allows pattern matching and destructuring to be used in similar contexts (for example, future proposals for multi-methods or the like). However, pattern matching JavaScript values requires in practice requires more expressive power than simple destructuring gives us. This proposal adds additional patterns to fill the gaps. It may be reasonable to depart further from destructuring to increase the utility and expressiveness of this proposal (e.g. something like #17).
The syntax of object and array patterns deliberately hews closely to destructuring which is advantageous for a couple reasons. First, it aligns with existing syntax that developers are familiar with. Second, it allows pattern matching and destructuring to be used in similar contexts (for example, future proposals for multi-methods or the like). However, pattern matching JavaScript values requires in practice requires more expressive power than simple destructuring gives us. This proposal adds additional patterns to fill the gaps. It may be reasonable to depart further from destructuring to increase the utility and expressiveness of this proposal (e.g. something like [#17](https://github.com/tc39/proposal-pattern-matching/issues/17)).

## Object Patterns
Object patterns match objects with certain properties. Additional properties may be present on the matched object. Examples:
Expand Down

0 comments on commit a0ec829

Please sign in to comment.