Creates array of specified length using generator function
Length of array
Function to generate each element
Generated array
Creates array of specified length using generator function