JavaScript try and catch understanding.