Executes a function if the value is defined

  • Type Parameters

    • T

    Parameters

    • x: undefined | T

      The value to check

    • f: (x: T) => void

      Function to execute if x is defined

    Returns void

    Result of f(x) if x is defined, undefined otherwise