Compliment generator

Thanks for coming to share your portfolio Project with other learners!

When posting your project for review, please be sure to include the following:

  • Your review of the Project. Was it easy, difficult, just right?
  • An estimate of how long it took you to complete
  • The link to your code repo

We hope you enjoyed this project!

const phraseFactory = (head, mod) => {return {head, mod};}; let compliments = []; compliments.push(phraseFactory('You have a great sense of ', ['humor', 'style', 'adventure'])); compliments.push(phraseFactory('You are always so ', ['kind', 'generous', 'supportive'])); compliments.push(phraseFactory('You have a unique perspective on ', ['life', 'work', 'relationships'])); compliments.push(phraseFactory('You are incredibly ', ['smart', 'talented', 'creative'])); compliments.push(phraseFactory('You have a contagious ', ['energy', 'enthusiasm', 'optimism'])); compliments.push(phraseFactory('You have a heart of gold and always ', ['put others first', 'help those in need', 'make people feel welcomed'])); compliments.push(phraseFactory('You are a natural ', ['leader', 'teacher', 'problem-solver'])); compliments.push(phraseFactory('You have a way of ', ['making people feel at ease', 'bringing out the best in others', 'inspiring those around you'])); compliments.push(phraseFactory('You are a true ', ['gem', 'ray of sunshine', 'breath of fresh air'])); const complimentIndex = Math.floor(Math.random() * compliments.length); const compliment = compliments[complimentIndex]; const modIndex = Math.floor(Math.random() * compliment.mod.length); console.log(compliment.head + compliment.mod[modIndex]);