Skip to main content
Module

x/lodash_es/mod.ts>fill

lodash for deno use
Latest
function fill
import { fill } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

Fills elements of array with value from start up to, but not including, end.

Note: This method mutates array.

Examples

var array = [1, 2, 3];

_.fill(array, 'a'); console.log(array); // => ['a', 'a', 'a']

_.fill(Array(3), 2); // => [2, 2, 2]

_.fill([4, 6, 8, 10], '', 1, 3); // => [4, '', '*', 10]

Parameters

array

The array to fill.

value

The value to fill array with.

start
end