function oneOf(collection) { return collection[Math.floor(Math.random()*collection.length)]; } function playSound(sound, extension = null) { let audio = new Audio('/timetrack/assets/audio/' + sound + (extension ?? '.mp3')); audio.play(); } function getRandomID() { let text = ''; const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; for (let i = 0; i < 10; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); } return text; }