Skip to main content
variable attempt2
import { attempt2 } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Attempts to invoke a function with the provided arguments, returning either the result or the caught error object.

Use a try... catch block to return tuple of value and Error

type

(fn: (...args: any[]) => any, ...args: any[]) => unknown