Skip to content

Day 5: Map, Set, JSON & Week 5 Mini-Project

Work with unique collections (Set), keyed collections (Map), serialize data with JSON, and complete the Week 5 refactoring mini-project.

// Unique items
const tags = new Set(['html', 'css', 'html', 'js']);
console.log([...tags]); // ['html', 'css', 'js']
// JSON serialization
const user = { id: 1, name: 'Sara' };
const jsonString = JSON.stringify(user);
const parsedObj = JSON.parse(jsonString);

Week 5 Mini-Project: Modular Catalog Refactoring

Section titled “Week 5 Mini-Project: Modular Catalog Refactoring”

Project Requirements:

  1. Split your Week 4 inventory project into modules:
    • data.js: Product inventory array.
    • operations.js: Filter, sort, and reduce calculation functions.
    • main.js: Imports and orchestrates display logic.
  2. Refactor all functions to modern ES6 syntax (destructuring, spread, optional chaining).