We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 2.1.6
Code
[...Array(5)]
Expected behavior: Array filled with undefined 5 times (this is how it should be by the spec and how Chrome/FF/Safari do it)
undefined
Actual behavior: Empty array with length set to 5
The text was updated successfully, but these errors were encountered:
Typescript compile it to Array(5).slice(); https://www.typescriptlang.org/play/#src=%5B...Array(5)%5D%0D%0A
Array(5).slice();
Sorry, something went wrong.
@alex3165 yes, it does, and this is wrong because it gives non spec compliant result
@zuzusik Agreed, it is not really expected
Duplicate of #8856
No branches or pull requests
TypeScript Version: 2.1.6
Code
Expected behavior:
Array filled with
undefined
5 times (this is how it should be by the spec and how Chrome/FF/Safari do it)Actual behavior:
Empty array with length set to 5
The text was updated successfully, but these errors were encountered: