Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (18 loc) · 408 Bytes

newid.md

File metadata and controls

25 lines (18 loc) · 408 Bytes

newid

Generates a unique id value.

function newid(prefix:string = 'id'): string

Args

prefix:string
Prefix the return value with this string

Returns

A new unique id

Examples

import newid from 'utils/newid';

console.log(newid());          // Outputs: 'id1'
console.log(newid());          // Outputs: 'id2'
console.log(newid('prefix-')); // Outputs: 'prefix-3'