Convert iterator into array