結果 : how to avoid undefined in javascript