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

Javascript project-pizza #143

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

Conversation

Heleneabrahamsson
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.

Nice job with the project! 🍕

JavaScript

  • Your use of if-else statements to handle the different choices has a good flow 👍
  • When checking the age, you're assuming the user enters a number, but in JavaScript, prompt always returns a string. To avoid any issues, you could use parseInt() to ensure age is treated as a number:
let age = parseInt(prompt("Is this food for a child or an adult? Please type your age:"));

Clean Code

  • Descriptive and clear variable names, nice job! One minor suggestion would be to use more descriptive names for simple variables like name—maybe userName could be more self-explanatory.
  • Overall your code is well-indented! Just one thing I'd like to point out regarding else if, it should be on the same line as the end of the if:
if (something) {
  //
} else if (something) {
  //
}

Overall really good job Heléne, and I look forward to seeing what you will create next 🥳

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