The type of the first value.
The type of the second value.
Returns the first value of this first/second pair.
The first value of this first/second pair.
Returns the second value of this first/second pair.
The second value of this first/second pair.
Class Pair implments KoconutEquatable. The 'equalsTo' method of this is basically check each individual element (first/second) are same or not. When the type of each element is child of KoconutEquatable, it'd be done by using its 'equalsTo' method. Otherwise, it'd be done simply by '==' operator.
Turns this Pair instance into a simple array.
Turns this Pair instance into a simple JSON object string.
Create a Pair instance by iterable two values pair.
Values pair of first/second as iterable.
const myPair = Pair.from(["Apex","Captain"])
console.log(myPair)
// ↑ Pair { firstElement: 'Apex', secondElement: 'Captain' }
Generated using TypeDoc
Represents a generic pair of two Values. There is no meaning attached to values in this class. It can be used for any purpose. Pair exhibits values semantics, i.e. two pairs are equal if both components are equal. However, if any of those two values are instance of class, you'd better make the class explicitly distinguishable by inheriting KoconutEquatable. Please, check the example of 'equalsTo' method