結果 : javascript wait for async loop to finish