Can someone explain me the intended usage of array.takeWhile?
takeWhileCalculate the longest initial subarray for which all element satisfy the specified predicate, creating a new Array.
takeWhileCalculate the longest initial subarray for which all element satisfy the specified predicate, creating a new Array.
I thought it was some kind of array.keep, but it results in an array of 0 elements when I give it a simple predicate. The same predicate applied to array.fikter gives me an array of 17 elements. I expected take while to give me the inverse