Creates an error result with the given error.
The type of the error.
Optional
The error to wrap in an error result. Defaults to a new Error if not provided.
A ResultErr containing the error.
const [error, value] = err(new Error("Oops")); // [Error: Oops, null] Copy
const [error, value] = err(new Error("Oops")); // [Error: Oops, null]
const [error, value] = err(); // [Error, null] Copy
const [error, value] = err(); // [Error, null]
Creates an error result with the given error.