Extension methods for Array[A] class
This method and "fHead" removes the need for headOption in the majority of case. Use fHead when are interested in the tail value
foreach loop with counter
maps to a Arr of B.