@jiminp/tooltool
    Preparing search index...

    Function identity

    • Returns the provided value unchanged.

      Useful as a default callback, placeholder function, or when working with higher-order functions that require an identity mapping.

      Type Parameters

      • T

      Parameters

      • t: T

        The value to return.

      Returns T

      The same value that was passed in.

      identity(42);        // 42
      identity("hello"); // "hello"