Create a new array of a specified length and fill it with a given value.
Time complexity: O(n)
Space complexity: O(n)
Value to fill the array with
The length of the array
The filled array
fill('a', 3); // ['a', 'a', 'a'] Copy
fill('a', 3); // ['a', 'a', 'a']
Array
Create a new array of a specified length and fill it with a given value.
Time complexity: O(n)
Space complexity: O(n)