Day 5: Map, Set, JSON & Week 5 Mini-Project
Daily Objective
Section titled “Daily Objective”Work with unique collections (Set), keyed collections (Map), serialize data with JSON, and complete the Week 5 refactoring mini-project.
1. Sets & JSON
Section titled “1. Sets & JSON”// Unique itemsconst tags = new Set(['html', 'css', 'html', 'js']);console.log([...tags]); // ['html', 'css', 'js']
// JSON serializationconst 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:
- 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.
- Refactor all functions to modern ES6 syntax (destructuring, spread, optional chaining).