Skip to content

Javascript project-pizza#143

Open
Heleneabrahamsson wants to merge 9 commits intoTechnigo:mainfrom
Heleneabrahamsson:main
Open

Javascript project-pizza#143
Heleneabrahamsson wants to merge 9 commits intoTechnigo:mainfrom
Heleneabrahamsson:main

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