Back to Arrays
fill
Create an array filled with a value.
Syntax
fill(val, n) → Array of n copies of val
Backends
TypeScript
Description
Create an array filled with a value.
Parameters
| Name | Description |
|---|---|
| val | Fill value |
| n | Number of elements |
Returns
Array of n copies of val