Endo API documentation - v0.2.0 / Exports / @endo/common / list-difference
Module: list-difference
Table of contents
Functions
Functions
listDifference
▸ listDifference<V
>(leftList
, rightList
): V
[]
Return a list of all the elements present in the leftList
and not in the rightList
. Return in the order of their appearance in leftList
. Uses the comparison built into Set
membership (SameValueZero) which is like JavaScript's ===
except that it judges any NaN
to be the same as any NaN
and it judges 0
to be the same a -0
.
This is often used on lists of names that should match, in order to generate useful diagnostics about the unmatched names.
Type parameters
Name | Type |
---|---|
V | extends unknown |
Parameters
Name | Type |
---|---|
leftList | V [] |
rightList | V [] |
Returns
V
[]