This project was a part of the first sprint of the Technigo web developer bootcamp and the aim was to learn basic Javascript concepts like variables, conditionals and native methods.
Using conditional operators as if/else statements, switch statements and ternary statements the user gets to choose between dishes and different subcategories. The hardest part was to get dry code for a switch statement where the user got to chose 1, 2 or 3 for a subcategory of the main dishes pizza, pasta and salad. First I declared the chosen subtype with a long if/else statement (chosing the main dish) with several switch statements within it (chosing the subtypes). The code was very repetative. After realising I could declare the subtype variables with arrays and then simply selecting the subtype by chosing the array placement, it made the code a lot more dry.
In this challenge I also learned the prompt method to collect input data from the user and store it in a variable.