結果 : how to make method synchronized in javascript