結果 : js wait until function is done