arrayPartition

arrayPartition(array array, function callback) → array<array> newArray
Returns a new array containing two lists: the first contains all key/value pairs for which the callback function returned true; the second contains all the others. If the callback function takes one parameter, the source array's value is sent; if it takes two parameters, the first is the key and the second is the value.

Returns a new array containing two lists: the first holds all the values for which the callback function returned true, the second holds all the others. The callback function receives the arguments (value, position, array), in this order.

In LS1-3, the two lists keep the key/value pairs. If the callback function takes one parameter, the value from the source array is sent; if it takes two parameters, the key and the value are sent.

Parameters
Return