Skip to content

Array(n) is spreaded incorrectly in arrays #14088

Closed
@zuzusik

Description

@zuzusik

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)

Actual behavior:
Empty array with length set to 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions