Mixed Messages - Pick up lines generator

Hi everyone my name is Hector Acosta, I’m taking the backend engineer path. I think this was a easy project since im not completely new to programming, however the GitHub part took a few hours to completely understand how it works. It took about 20minutes to code the program.


I would like to have some feedback, thanks.

1 Like

I really liked this one! I think this was a great program and provided just the right amount of humor :laughing:. I really like how you created the randomCategory function with the switch statement. I am pretty new to programming, so this is definitely a function I am going to use/modify in order to figure out other functions for it. Thanks for this great program! I learned a lot from reviewing your code!

I also liked that your README.md file was short and sweet. I think I need to cut out my chatterbox crap on mine :laughing:

1 Like

Thanks! I really appreciate your feedback. :grin:
I would be very happy to help you with your projects and so we learn from each other.

1 Like

Sorry for the delay in response. I think learning together would be a great idea! Check out my project for this one and let me know what you think. I am doing the Full Stack Engineer course, but I am loving the front end development section. I am familiar with HTML and CSS, but pretty new to programming in JavaScript even though I have a bit of a background in C++.

Let me know your thoughts!

const randomCategory = () => { const randCat = Math.floor(Math.random()*2); let category = ''; switch(randCat){ case 0: category = 'normal'; break; case 1: category = 'innocent'; break; case 2: category = 'hot'; } return category; } console.log(randomCategory());

your random number generation would return only 0 to 1, since you floored it.
therefore you wont get category ‘hot’
Change 2 to 3 if you floor it.