Skip to content

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

NameType
Vextends unknown

Parameters

NameType
leftListV[]
rightListV[]

Returns

V[]

Defined in

list-difference.js:15