Skip to content

Jonas pizza project#152

Open
Jonash189 wants to merge 6 commits intoTechnigo:mainfrom
Jonash189:main
Open

Jonas pizza project#152
Jonash189 wants to merge 6 commits intoTechnigo:mainfrom
Jonash189:main

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