toFilled (Functional Programming) es-toolkit
Creates a function that returns a filled copy of an array. Use it with pipe.
Info
Usage
toFilled fills a copy of the piped array with value from start up to, but not including, end. It follows Array.prototype.fill index semantics and does not mutate the input array.
Parameters
valueUrequired
The value to write into the returned array.
startnumber, optionalrequired
The start index. Defaults to 0.
endnumber, optionalrequired
The end index. Defaults to the array length.
Returns
A function that maps a readonly T[] to a filled copy.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.