Exclude function

Returns an array containing the elements of another array, excluding elements at a given list of indices.

function Exclude (remove : Int[], array : 'T[]) : 'T[]

Type Parameters

'T

The type of the array elements.

Input

remove
Int[]

An array of indices denoting which elements should be excluded from the output.

array
'T[]

Array of which the values in the output array are taken.

Output

'T[]

An array output such that output[0] is the first element of array whose index does not appear in remove, such that output[1] is the second such element, and so forth.

Examples

let array = [10, 11, 12, 13, 14, 15];
// The following line returns [10, 12, 15].
let subarray = Exclude([1, 3, 4], array);