partition multimethod

Methods

partition(something:Eachable1, pattern:Any=method) Source: stdlib.ngs:1537
Partition elements in something according to the pattern into two arrays. First array contains all elements that match the pattern. The second array contains all elements that do not match the pattern.

Parameters

somethingEachable1
patternTest function or anything else acceptable by (=~), defaults to Bool.constructors

Returns

Array with two arrays in it

Example

partition([1,10,2,20], X>=10)  # [[10, 20], [1, 2]]