TAKEWHILE
Returns an array consisting of all items from the beginning of an array which satisfy the specified condition.
Syntax
=TAKEWHILE(array, test)
Arguments
Argument | Type | Description |
---|---|---|
array | Array | The array of values |
test | Lambda | Test to perform on each item of the array to determine if the item is included |
Examples
=TAKEWHILE([1, 3, 5, 2, 4, 6, 1], x => ISODD(x))
→[1, 3, 5]
=TAKEWHILE(["A", "B", "C", "d", "E", "f"], x => UPPER(x) = x)
→["A", "B", "C"]
Updated 7 months ago