結果 : javascript wait for function to be defined