Mixed Message generator

I found the project easy but a good start to practice with git and github. It took me about one hour to finish it, as I was playing with git as well.

Here is my code and the link to Github, I would be grateful to see any comments on them


function getRandomComponent (arr) { let arrayLength = arr.length; let randomIndex = Math.floor(Math.random()*arrayLength); return arr[randomIndex]; } const phraseComponents = { general: ['Now you\'re feeling like a', 'You fit well with a', 'Don\' act as a'], chineseAstro: ['Dragon', 'Tiger', 'Sheep'], inspirational: ['boss', 'confident person who can achieve a lot', 'tiger! Go ahead! You can do it!'], jokes: ['red nose clown', 'cuty cuty bumblebee in bikini', 'old fart'] }; let generalExp = getRandomComponent(phraseComponents.general); let randomTypeInd = Math.floor(Math.random()*3+1); let type = Object.keys(phraseComponents)[randomTypeInd]; switch (type) { case 'chineseAstro': let astrologyExp = getRandomComponent(phraseComponents.chineseAstro); console.log(generalExp + ' ' + astrologyExp); break; case 'inspirational': let inspirationalExp = getRandomComponent(phraseComponents.inspirational); console.log(generalExp + ' ' + inspirationalExp); break; case 'jokes': let jokeExp = getRandomComponent(phraseComponents.jokes); console.log(generalExp + ' ' + jokeExp); break; }