tc39 / proposal-pattern-matching

Pattern matching syntax for ECMAScript
https://tc39.es/proposal-pattern-matching/
MIT License
5.45k stars 89 forks source link

Repeat a pattern many times inside array pattern #308

Closed Jack-Works closed 9 months ago

Jack-Works commented 9 months ago
[
Number, Number, Number,
Number, Number, Number,
Number, Number, Number,
Number, Number, Number,
]

? But syntax, how?

[Number * 12]
ljharb commented 9 months ago

Seems like a potential follow-on but definitely not something that belongs in the core proposal.

tabatkins commented 9 months ago

Yeah, this is absolutely something that should be a future addition (if ever - I don't think I've seen this in any other pattern-matching library).