結果 : how to handle uncaught type error in javascript