Skip to content

Day 5: Objects & Week 4 Mini-Project

Master JavaScript objects and build a product catalog with filtering, sorting, and total calculations.

const product = {
id: 101,
name: 'Wireless Mouse',
price: 29.99,
inStock: true,
applyDiscount(percent) {
this.price -= this.price * (percent / 100);
}
};
console.log(product.name);
console.log(Object.keys(product));

Week 4 Mini-Project: Product Inventory Manager

Section titled “Week 4 Mini-Project: Product Inventory Manager”

Project Requirements:

  1. Create an array of product objects (each with id, name, category, price, and inStock).
  2. Use filter to isolate in-stock items under $50.
  3. Use sort to sort remaining products alphabetically by name.
  4. Use reduce to compute the grand total inventory value.