結果 : javascript check if function exists before calling it