js try catch err.printstacktrace code example Example: js try catch err.printstacktrace try{ //some error } catch (err){ console.log(err.stack); }