Skip to main content

CommonCallFunctionByNameWarn

Callable

  • CommonCallFunctionByNameWarn<T>(FunctionName, ...args): Window[T] extends undefined ? ReturnType<any[any]> : ReturnType<Window[T]>

  • Behaves exactly like CommonCallFunctionByName, but logs a warning if the function name is invalid.


    Parameters

    • FunctionName: T

      The name of the global function to call

    • rest...args: Parameters<Window[T]>

      zero or more arguments to be passed to the function (optional)

    Returns Window[T] extends undefined ? ReturnType<any[any]> : ReturnType<Window[T]>

    • returns the result of the function call, or undefined if the function name isn't valid