-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
I'm really sorry if it's duplication but I couldn't find existing issue.
Code
new Array(3).fill()Expected behavior:
The JS output for this is just:
[undefined, undefined, undefined]I know there are more ways to fill dynamic empty array probably better ways but this use case serves many people in order to accomplish something like:
new Array(15).fill().map((v, i) => ({_id: `${i}`}))Actual behavior:
Throwing the following error: "Expected 1-3 arguments, but got 0"
I will be glad to create a PR to migrate the definition of value property to optional.
leotm and EnderShadow8
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug