結果 : how to make two function synchronous in javascript