Call the given function repeatedly, the given number of times.
number of times to call the given function
function to call repeatedly. Will be passed the zero-based count of the current iteration
collect - if you want to collect the returned values from the function instead.
Call the given function repeatedly, the given number of times.