Sometimes there is a need to have a random string in javascript to uniquely identify panels or other elements in DOM. If you are looking for fast and one line solution, you can use this snippet and adapt to your own requirements.
2. Random identifier
The following inline function will generate a random characters:
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}