Generates a unique string ID with an optional prefix.
Each call increments an internal counter to ensure uniqueness within the runtime.
An optional string to prepend to the generated ID. Default is an empty string.
A unique string ID.
1.2.0
uniqueId(); // "1"uniqueId("item_"); // "item_2"uniqueId("item_"); // "item_3" Copy
uniqueId(); // "1"uniqueId("item_"); // "item_2"uniqueId("item_"); // "item_3"
Generates a unique string ID with an optional prefix.
Each call increments an internal counter to ensure uniqueness within the runtime.