結果 : make function synchronous javascript