Function: equals()
Call Signature
equals<
T>(mb,ma):boolean
Allows quick triple-equal equality check between the values inside two maybe instances without having to unwrap them first.
ts
const a = Maybe.of(3);
const b = Maybe.of(3);
const c = Maybe.of(null);
const d = Maybe.nothing();
Maybe.equals(a, b); // true
Maybe.equals(a, c); // false
Maybe.equals(c, d); // trueType Parameters
T
T extends object
Parameters
mb
Maybe<T>
A maybe to compare to.
ma
Maybe<T>
A maybe instance to check.
Returns
boolean
Call Signature
equals<
T>(mb): (ma) =>boolean
Allows quick triple-equal equality check between the values inside two maybe instances without having to unwrap them first.
ts
const a = Maybe.of(3);
const b = Maybe.of(3);
const c = Maybe.of(null);
const d = Maybe.nothing();
Maybe.equals(a, b); // true
Maybe.equals(a, c); // false
Maybe.equals(c, d); // trueType Parameters
T
T extends object
Parameters
mb
Maybe<T>
A maybe to compare to.
Returns
(
ma):boolean
Parameters
ma
Maybe<T>
Returns
boolean