Open
Conversation
HIPPIEKICK
approved these changes
Sep 13, 2024
Contributor
HIPPIEKICK
left a comment
There was a problem hiding this comment.
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 ⭐
Comment on lines
+11
to
+12
| let selectedFood; | ||
| let subChoice = ""; |
Contributor
There was a problem hiding this comment.
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://jonas-restaurant.netlify.app/