1.1.1 • Published 1 year ago
@aaronburt/try v1.1.1
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'
}