Create a String representation of a Result instance.
An Ok instance will be Ok(<representation of the value>), and an
Err instance will be Err(<representation of the error>), where
the representation of the value or error is simply the value or error's own
toString representation. For example:
Create a
String
representation of aResult
instance.An
Ok
instance will beOk(<representation of the value>)
, and anErr
instance will beErr(<representation of the error>)
, where the representation of the value or error is simply the value or error's owntoString
representation. For example:--------------------------------- | ----------------------
toString(ok(42))
|Ok(42)
toString(ok([1, 2, 3]))
|Ok(1,2,3)
toString(ok({ an: 'object' }))
|Ok([object Object])
ntoString(err(42))
|Err(42)
toString(err([1, 2, 3]))
|Err(1,2,3)
toString(err({ an: 'object' }))
|Err([object Object])