Example 1 — Official: Fill the Whole Array
Omit the range to overwrite every index.
var array = [1, 2, 3];
_.fill(array, "a");
// array → ["a", "a", "a"] How It Works
- Source. Three numbers in
array. - Defaults.
start = 0,end = 3. - Write. Every index becomes
"a". - Mutate. The original variable now holds the filled array.

