@jiminp/tooltool
    Preparing search index...

    Function identity

    • Returns the provided value unchanged.

      Useful as a default callback or placeholder in higher-order functions.

      Type Parameters

      • T

        The value type.

      Parameters

      • t: T

        The value to return.

      Returns T

      The same value.

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