
array.fill() – Fills elements in an array with a static value from start index to end index (**mutable**).
๐ Syntax
array.fill(value, start = 0, end = array.length);
๐งช Example
new Array(3).fill(0); // [0,0,0]
array.fill() – Fills elements in an array with a static value from start index to end index (**mutable**).
array.fill(value, start = 0, end = array.length);
new Array(3).fill(0); // [0,0,0]
Comments
Post a Comment