結果 : how to make a function call synchronous in javascript