Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS
vanillajs-helpers > “randomId”
► randomId(length?: number
): string
Defined in randomId.ts:11
Generate a random id of designated length
randomId(); // -> eg. 'efuc6f1n4xf'
randomId(20); // -> eg. '3vsmrbxlh9at0vhcsf1xh'
Parameters:
Param | Type | Default value | Description |
---|---|---|---|
length | number |
10 | - |
Returns: string