function getRandomNumberElement(items: number[]): number { let randomIndex = Math.floor(Math.random() * items.length); return items[randomIndex]; } Code language: TypeScript (typescript)