What is the use of fill() method in JavaScript Arrays ?
The fill() method in JavaScript is used to fill all the elements of an array with a static value. It modifies the original array and returns the modified array.
Example: Here, the fill(0) method is applied to the myArray, which replaces all elements in the array with the value 0.