arrayWith
arrayWith is a JavaScript function that creates a new array populated with values generated by a provided callback function. It takes two arguments: the desired length of the new array and a mapping function. The mapping function is called for each index of the new array, from 0 up to, but not including, the specified length. The return value of the mapping function for each index becomes the element at that index in the newly created array.
The mapping function itself receives two parameters: the value at the current index (which is undefined in
arrayWith offers a more declarative approach compared to traditional loops for array initialization when the values