Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Jonas pizza project #152

wants to merge 6 commits into from

Conversation

Jonash189
Copy link

Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a 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 ⭐

Comment on lines +11 to +12
let selectedFood;
let subChoice = "";
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants