how to catch error inside closure/ifffy functions in outter try catch without using promise in javascript
//closures
function abc(a,b){
try{
setTimeout(()=>{
throw new Error("error")
},0)
}catch(e){
console.log(e)
}
}
abc(10,0)
//iify functions
(function abc(a,b){
try{
setTimeout(()=>{
throw new Error("error")
},0)
}catch(e){
console.log(e)
}
})(10,0)