Tweakr
    Preparing search index...

    Function uniqueId

    • Generates a unique string ID with an optional prefix.

      Each call increments an internal counter to ensure uniqueness within the runtime.

      Parameters

      • prefix: string = ""

        An optional string to prepend to the generated ID. Default is an empty string.

      Returns string

      A unique string ID.

      1.2.0

      uniqueId();         // "1"
      uniqueId("item_"); // "item_2"
      uniqueId("item_"); // "item_3"