DEV Community

Cover image for Building a Product Management System Using JavaScript 🛒💻
Narasimma Radhakrishnan
Narasimma Radhakrishnan

Posted on

Building a Product Management System Using JavaScript 🛒💻

As part of my JavaScript learning, I created a simple Product Management System using HTML, CSS, and JavaScript.

This project helped me understand how to work with arrays, objects, functions, and CRUD operations.

What Can We Do?

My project has four basic operations:

➕ Add a product
👀 View a product
✏️ Update a product
🗑️ Delete a product

These are called CRUD operations.

Creating a Product

I used an object to store product details.

let product = {
  name: "Laptop",
  price: 50000
};

console.log(product);
Enter fullscreen mode Exit fullscreen mode

Storing Products

I used an array to store multiple products.

let products = [
  { name: "Laptop", price: 50000 },
  { name: "Mouse", price: 500 }
];

console.log(products);
Enter fullscreen mode Exit fullscreen mode

Adding a Product

products.push({
  name: "Keyboard",
  price: 1000
});
Enter fullscreen mode Exit fullscreen mode

push() adds a new product to the array.

Updating a Product
products[0].price = 45000;

Now the laptop price is changed.

Deleting a Product
products.splice(1, 1);

This removes a product from the array.

What I Learned

While building this project, I practiced:

JavaScript Objects
Arrays
Functions
CRUD operations
push()
splice()
Loops
Conclusion

This was a simple project, but it helped me understand how basic JavaScript concepts work together.

My learning approach: Learn → Practice → Build 🚀

javascript #webdev #beginners #coding

Top comments (0)