結果 : how to define function in javascript object