結果 : javascript wait until function is done