functiongetRandomString(length) {constallowedCharacters='abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';constallowedCharacterLength=allowedCharacters.length;let result ='';for ( let i =0; i < length; i++ ) { result +=allowedCharacters.charAt(Math.floor(Math.random() * allowedCharacterLength)); }return result;}
functiongetRandomColor() {constavailableCharacters='0123456789ABCDEF';constavailableCharacterLength=availableCharacters.length;let color ='#';for (let i =0; i <6; i++) { color += availableCharacters[Math.floor(Math.random() * availableCharacterLength)]; }return color; }