結果 : how to call a method inside a function in javascript