Generates a unique ID with an optional prefix.
This function returns a string that combines a prefix (default is 'id') with a unique incrementing number. It ensures each call will return a unique identifier.
uid(); // => 'id_1'uid('test'); // => 'test_2'uid('0'); // => '0_3' Copy
uid(); // => 'id_1'uid('test'); // => 'test_2'uid('0'); // => '0_3'
Generates a unique ID with an optional prefix.
This function returns a string that combines a prefix (default is 'id') with a unique incrementing number. It ensures each call will return a unique identifier.