vanillajs-helpers

Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS

View the Project on GitHub Tokimon/vanillajs-helpers

vanillajs-helpers > “randomId”

External module: “randomId”

Index

Functions


Functions

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