Create a String representation of a Maybe instance.
String
Maybe
A Just instance will be Just(<representation of the value>), where the representation of the value is simply the value's own toString representation. For example:
Just
Just(<representation of the value>)
toString
toString(Maybe.of(42))
Just(42)
toString(Maybe.of([1, 2, 3]))
Just(1,2,3)
toString(Maybe.of({ an: 'object' }))
Just([object Object])
toString(Maybe.nothing())
Nothing
The value to convert to a string.
The string representation of the Maybe.
T The type of the wrapped value; its own .toString will be used to print the interior contents of the Just variant.
.toString
Generated using TypeDoc
Create a
String
representation of aMaybe
instance.A
Just
instance will beJust(<representation of the value>)
, where the representation of the value is simply the value's owntoString
representation. For example:toString(Maybe.of(42))
Just(42)
toString(Maybe.of([1, 2, 3]))
Just(1,2,3)
toString(Maybe.of({ an: 'object' }))
Just([object Object])
toString(Maybe.nothing())
Nothing