* Creates an array of a specified length and populates it with the results of calling a provided function on every index in the array.
*
* @templateT - The type of elements in the resulting array.
* @param{number}length - The length of the array to create.
* @param{(_: unknown, index: number) => T}[transform=(_, index) => index] - The function to call on every index in the array. By default, it returns the index itself.
* @returns{T[]} An array of length `length` with its elements being the result of the `transform` function.