# ifLet | Welshman Docs
Documentation for Welshman Docs

# Function ifLet

Executes a function if the value is defined

- ifLet< T >(x: undefined | T , f: (x: T ) => void): void

- #### 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

  - Defined in packages/lib/src/Tools.ts:18