-
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
Jonas pizza project #152
base: main
Are you sure you want to change the base?
Jonas pizza project #152
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.
Super good job with this project Jonas! 🍕
JavaScript
- Your code has a nice flow and you've succesfully put together all the learning goals and created this pizza bot ⭐
- Nice error handling in some cases! Consider storing all user inputs in variables, then handling errors at the end of the flow instead of repeating alert() multiple times. You could also consider providing the user with a retry option if they select something invalid, which would make the experience more interactive.
Clean Code
- While your variable names are generally good, subChoice could be a bit more descriptive, such as dishType or specificDish. This will help make the code more self-explanatory.
- Be consisten with whether or not you're using semicolons. Don't mix!
- Make sure that you indent your code properly, e.g. instead of:
if (foodChoice === "1") {
selectedFood = "Pizza";
}
else if (foodChoice === "2") {
selectedFood = "Pasta";
}
this is how it should be:
if (foodChoice === "1") {
selectedFood = "Pizza";
} else if (foodChoice === "2") {
selectedFood = "Pasta";
}
Overall, really good job! With a few minor things to think about going forward, you will continue to improve ⭐
let selectedFood; | ||
let subChoice = ""; |
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.
As we talked about during demo, try to be consistent and declare all variables as the type you expect them to be (so empty string works fine for strings)
https://jonas-restaurant.netlify.app/