Implement a take_while
method on Array
take_while
runs the block with each element of the Array
in turn until it returns false, then it stops and returns an Array
of the prior elements.
Example
Input >> [1,2,3,4].take_while { $0 < 3 }
Output >> R8: Array = 2 values {