Is there anyway to improve this javascript function with try and catch

Printable View