Compiler produces invalid Array().keys().slice()
output
#18247
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
I was looking for a compact way to write a 'range' function and stumbled across this stackoverflow answer.
The spread operator variant compiles successfully but the output is not valid.
TypeScript Version: 2.5.2
Code
Expected behavior:
The
withSpread
variant should produce valid JS that generates[0, 1, 2, 3, 4]
Actual behavior:
Resulting JS throws
TypeError: Array(...).keys(...).slice is not a function
The text was updated successfully, but these errors were encountered: