sirisian / ecmascript-types

ECMAScript Optional Static Typing Proposal http://sirisian.github.io/ecmascript-types/
453 stars 4 forks source link

Add destructuring rest array examples #52

Closed sirisian closed 4 years ago

sirisian commented 4 years ago
let [a:uint8, ...[b:uint8]] = [10, 20]; // b is 20

Remember that this needs to support nesting. I don't foresee an issue.

let [a:uint8, ...[...[b:uint8]]] = [10, 20]; // b is 20
sirisian commented 4 years ago

https://github.com/sirisian/ecmascript-types#array-rest-destructuring