DEV Community

Abbos Soatmurodov
Abbos Soatmurodov

Posted on

My First JavaScript Project: What I Learned (and What I Did Wrong)

My First JavaScript Project: What I Learned

Hi DEV community! πŸ‘‹

I just finished my first real JavaScript project - a restaurant
ordering app. It works, but looking back at my code, I realize
I made a lot of beginner mistakes.

The Project

[Screenshot yoki GIF qo'ying]

Simple ordering interface where you can:

  • Browse menu items
  • Add to cart
  • See order total
  • Complete payment

πŸ”— GitHub: https://github.com/semizemes/Jimmy-s-Diner

What I Think I Did Wrong

1. Too Many Global Variables

I declared like 10+ variables at the top for DOM elements...

2. Repetitive Code

My displayOrder() function literally copies the same logic
three times for pizza, hamburger, and beer.

3. Hard-coded Everything

Item IDs are 0, 1, 2 everywhere in the code. If I add a new
item, I'd have to change code in multiple places.

Questions for the Community

  • How would you refactor this?
  • What patterns should I learn for this type of app?
  • Any resources you'd recommend?

I'm eager to learn! Drop your suggestions below πŸ‘‡

CodeNewbie #100DaysOfCode

Top comments (1)

Collapse
 
shahrouzlogs profile image
Shahrouz Nikseresht

Hi, very welcome to DEV Community! πŸ‘‹

Great job on finishing your first JavaScript project, that’s a huge milestone.

Your write-up is clear and honest, and it’s always awesome to see beginners share what they learned along the way.

Keep experimenting, keep building, and keep posting your progress.

The community loves seeing projects like this. πŸš€