Occasionally I need to generate an id and end up doing something like:
Math.floor(Math.random() * 1000000000)
which just feels a little hackish, but generating a full UUID seems like overkill. But this generate a short random alphanumeric string:
Which gives you something like “d6gykt0qjmu” a decent simple random id, and feels alot more elegant.