predictype / predicates/symbols/symbolComparison / symbolComparison
symbolComparison(
source
,oper
,target
):boolean
Defined in: predicates/symbols/symbolComparison.ts:25
Compares two symbols for equality or inequality using the specified operation.
symbol
The first symbol to compare.
The comparison operation to perform (e.g. ‘equals’, ‘not_equals’).
symbol
The second symbol to compare.
boolean
True if the comparison is valid according to the operator, otherwise false.
If the operation is not recognized.
const a = Symbol('foo');
const b = Symbol('foo');
symbolComparison(a, 'equals', a); // true
symbolComparison(a, 'not_equals', b); // true
Supported Operators: