predictype / predicates/sets / setComparison
setComparison<
T
>(source
,oper
,target
):boolean
Defined in: predicates/sets/setComparison.ts:27
Compares two sets for equality or inequality using the specified operation.
T
Set
<T
>
The first set to compare.
The comparison operation to perform (e.g. ‘equals’, ‘not_equals’).
Set
<T
>
The second set to compare.
boolean
True if the comparison is valid according to the operator, otherwise false.
If the operation is not recognized.
const a = new Set([1, 2, 3]);
const b = new Set([1, 2, 3]);
const c = new Set([4, 5]);
setComparison(a, 'equals', b); // true
setComparison(a, 'not_equals', c); // true
Supported Operators: