@aaronburt/try
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

TryCatch

tryCatch()

function exampleFunction(st){
    return st;
}

const result = tryCatch(exampleFunction, 'this is a string');

result // '[null, 'this is a string']'

if(result[0] === null){
    console.log(result[1]) // 'this is a string'
}

Package Sidebar

Install

npm i @aaronburt/try

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

1.88 kB

Total Files

6

Last publish

Collaborators

  • aaronburt