About the Portfolio Project: Mixed Messages category

Hi everyone!

I just finished the mixed messages portfolio. I really had fun doing this one. Watching every other project seems like I did it quite differently but at least I got it right. Well, mine is about a fortune teller who says ‘How will you die’, I got really creative there. Hope you like it :slight_smile:.

My Mixed Messages Repo

Any feedback would be nice. Thanks!

Hi @rebeccaeng3706049794!

I really liked yours! Actually, we did it pretty similarly. I also used fairy tale creatures and places.

I checked your code and you can actually make your randomMessage function shorter, as you are doing just an operation. Remember that we can tell what to return by getting rid of the brackets. Try this:

const randomMessage = (array) => array[Math.floor(Math.random() * array.length)];

Don’t forget to check out mine. I would love your feedback.

Wow! Very good job @antoinepoujaud467445!

As well, I didn’t use an object at first but seeing everyone else’s I thought it could be a nice implementation. Never the less, I think yours is very concise. Not a lot of lines put in and it works fine. Unfortunately, I don’t speak French, so I couldn’t understand the messages. It would be cool if you changed it so we could understand.

Speaking of being concise, there is a way that to make your chooseRandomMessagePart function in a single line. Check the MDN Arrow Function documentation and tell me if you can figure it out by your own.

Don’t forget to check out my repository too. I would love your feedback.

This is my message system.
Nothing flash, have kept the code simple.

Hello @didash and thx for your feedback!

I tried your fortune teller script it is very cool and fun you have been pretty creative.
Just be careful with your randomNumber function because you create a variable “max” and give it a value of 12. But each of your “randomData” contains 12 elements and an array start at 0. So you’ll have an undefined value if your randomNumber equals 12. :slight_smile:

About your suggestion about my chooseRandomMessagePart function, you’re right but sometimes, when it’s a little complicated mathematical operation I prefer to clearly separate my code so it will be more readable (at least for me ^^)

Thanks again for your feedback :wink:

Hey everyone!

Here’s a link to my Mixed Messages Project in GitHub: GitHub - frivolousvision/git_practice

Taking a look at other individuals’ projects, I’m wondering If I went about this in the correct manner. However, it does work as hoped in the terminal via node. Any feedback is greatly appreciated. Thank you!