Attempt to call a function returning either the result or an error if one occurs
either the result of f or an error
attemptOrCatch(() => { throw new Error() }) // returns error
attemptOrCatch(() => 'hello') === 'hello'
the function to call
Generated using TypeDoc
Attempt to call a function returning either the result or an error if one occurs
Returns
either the result of f or an error
Example
Example