Skip to main content

Function: listDifferenceUpdate()

listDifferenceUpdate<T, U>(l1, l2, key?): T[]

Defined in: src/utils/iterables.ts:86

Return the elements of l1 that are not present in l2.

An optional key function determines which elements count as equal. Mirrors ManimCE list_difference_update.

Type Parameters​

T​

T

U​

U

Parameters​

l1​

readonly T[]

l2​

readonly U[]

key?​

KeyFn<T | U>

Returns​

T[]

Example​

listDifferenceUpdate([1, 2, 3, 4, 1], [2, 4]); // [1, 3, 1]