Skip to main content

Function: listUpdate()

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

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

Return a new list of the elements of l1 not present in l2, followed by every element of l2. Order is preserved. Mirrors ManimCE list_update.

Type Parameters​

T​

T

U​

U

Parameters​

l1​

readonly T[]

l2​

readonly U[]

key?​

KeyFn<T | U>

Returns​

(T | U)[]

Example​

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