結果 : how to prevent undefined value in javascript