Skip to content

Jonas chatbot#286

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

Jonas chatbot#286
Jonash189 wants to merge 3 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.

Great job building this chatbot café! ☕

JavaScript

  • I see you’ve added DOMContentLoaded to ensure that all DOM elements are available before interacting with them. Nice idea!
  • Functions like showMessage, handleNameInput, handleDrinkChoice, and others are well-defined and break down the logic into smaller, manageable parts.
  • Solid conditions and flow, but it would be nice to see some other input options for users (e.g. buttons), but great that you're validating the input and continue to prompt the user
  • There is some repeated logic across the input handling functions (handleDrinkChoice, handleFoodChoice, handleDishChoice). Consider creating a more generic input validation function to simplify the code.
  • Great idea clearing the input! You could create a helper function (e.g., clearInput()) to streamline this action.

Clean Code

  • Be consistent with if you're using single or double quotes

Overall, good job! However I would love to see you go a bit more wild with input options another time 😉

const input = nameInput.value; // Get input from user
nameInput.value = ""; // Clear input field

if (!isAskingForDrink && !isAskingForFood && !isChoosingDish) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, couldn't this be isAskingForName 👀

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