Closed
Description
TypeScript Version: 1.8
Target: ES5
The following code:
[...(new Array(5))]
translates into:
(new Array(5)).slice();
However, the ES6 meaning is not the same. See the output below:
> [...(new Array(5))]
[ undefined, undefined, undefined, undefined, undefined ]
> (new Array(5)).slice();
[ , , , , ]
Expected behavior:
Array.apply(null, Array(5))