結果 : how to avoid undefined value in javascript