-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Week 4: Pizzabot #139
base: main
Are you sure you want to change the base?
Week 4: Pizzabot #139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job with this project 🤖
JavaScript
- Your code is logically structured and really nice to see you're using functions as well to structure it even more modular ⭐ Just remember that functions (as well as other JS variables) should be named with camelCase and not PascalCase
- You're using string concatenation with the + operator, which works fine but could be improved by using template literals for better readability and less error-prone code. Example:
alert(`You have chosen ${chosenSubtype}. Thank you, ${userName}!`);
- In your QuestionFoodType() function, you're using parseInt() to convert user inputs into numbers, which is great for avoiding string comparison issues. Why not use it for the age and confirmation prompts too 😄
Clean Code
- Make sure to indent your code properly. else if and else statements should start on the ending previous line, e.g.
if (something) {
//
} else {
//
}
Keep up the good work, and looking forward to see your progress using functions this week with the chatbot!
alert("Unfortunately, we don't have that type of dish, please try again!"); | ||
choosingFood(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job on your pizza-bot!
Your code is clean and easy to follow, with the descriptive comments throughout.
I really liked how you structured the conversation so that the user receives confirmation after each choice before moving on to the next question. It makes the interaction very clear and user-friendly.
Great job with the alert and prompt to interact with the user. I especially liked how you handled invalid inputs using if, else if, and return statements to ensure the user is prompted to pick again if they choose an invalid number.
Also, really nice touch with the image when the conversation is done!! Super cute!
Overall a great job, the code is well-structured, with thoughtful user interaction! Way to go :)
|
||
// Step 4 - Age | ||
// Your code goes here | ||
if (age <= 18) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely done!! I used a "child" or "adult" in strings but this is a cleaner way.
else { | ||
alert("Unfortunately, we do not have that item on the menu, try again."); | ||
QuestionSubFoodType(foodType); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!!
@Fannyhenriques thank you for your lovely review, very thorough!! <3 |
Here's my week 4 project for the pizzabot.
Netifly: https://pizzzabot.netlify.app/