Mixed Messages Project
This is my solution to the Mixed Messages portfolio project.
A few things to know about this code
- I tried to keep it simple
- I am in the back-end course on codecademy and this is my first attempt at JavaScript
Please let me know how I did and any place I might have missed something.
it looks pretty good, i would probably in order to reduce lines of code,
Your code:
const chooseAnimal = (arr) => {
let randNum = Math.floor(Math.random() * 9);
let userAnimal = arr[randNum];
console.log(greeting);
console.log(userAnimal);
//console.log(${greeting} ${userAnimal}
);
};
1 Like
Thank you! That was a great suggestion, never occurred to me to write it that way.
Also if anyone can edit this to where there is a button you can click to run this program with HTML I would be interested in seeing how that is done. Thx
Here is the repository for my version GitHub - Velarde78/message_generator and th link for the page as it would work, feel free to take a look at the code, how to make a button interactive you will learn it in the upcoming lessons about the DOM, Random Message hope this was helpful
1 Like
Very helpful! I appreciate it so much!