You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type of the array is the best common type of the individual elements and the element types of each of the "spread" elements.
Codegen
[1,2, ...items,3, ...moreItems]
becomes:
[1,2].concat(items,[3],moreItems)
If the array starts with a spread, you can concat off the spread:
[...items,1,2, ...moreItems]
becomes:
items.concat([1,2],moreItems)
Questions
What if it's 'any'? We don't know, so we have to codegen a slice. One possible issue is that .concat doesn't take array-like, it takes arrays only. This won't be a problem for spread arguments because .apply should take array-likes.
The text was updated successfully, but these errors were encountered:
Example from ES6
Type checking
The type of the array is the best common type of the individual elements and the element types of each of the "spread" elements.
Codegen
becomes:
If the array starts with a spread, you can concat off the spread:
becomes:
Questions
The text was updated successfully, but these errors were encountered: