Populates an array with a specified value.
Syntax
arrayObj.fill(value [ , start [ , end ] ]);
Parameters
arrayObj
Required. The array object.
value
Required. The value used to populate the array.
start
Optional. The starting index used to populate array values. The default value is 0.
end
Optional. The ending index used to populate array values. The default value is the length property of the this object.
Remarks
If start is negative, start is treated as length+start, where length is the length of the array. If end is negative, end is treated as length+end.
Example
The following code examples populate an array with values.
[0, 0, 0].fill(7, 1);
// Array contains [0,7,7]
[0, 0, 0].fill(7);
// Array contains [7,7,7]
Requirements
Supported in Microsoft Edge (Edge browser). Also supported in Store apps (Microsoft Edge on Windows 10). See Version Information.
Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Not supported in Windows 8.1.

