Create a new array of a specified length and fill it using the given function.
Time complexity: O(n)
Space complexity: O(n)
The length of the array
The filled array
mapFill(3, i => i + 1); // [1, 2, 3] Copy
mapFill(3, i => i + 1); // [1, 2, 3]
Array
Create a new array of a specified length and fill it using the given function.
Time complexity: O(n)
Space complexity: O(n)