Skip to content

London | ITP-May-2025 | Seddiq Azam | Module-Data-Flows | Destructuring #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

sedazam
Copy link

@sedazam sedazam commented Jul 27, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Implement Destructuring Exercises for Sprint 1

Overview

This PR implements several destructuring exercises demonstrating JavaScript ES6 destructuring patterns across multiple exercises in Sprint 1.

Changes Made

Exercise 1-2: Array and Object Destructuring

  • Refactored array iteration using destructuring for improved code clarity and readability
  • Enhanced Hogwarts array processing with destructuring for pet and occupation data
  • Implemented proper function parameter destructuring in introduceYourself function

Exercise 3: Takeout Order Receipt Calculator

  • Built a receipt calculator that uses object destructuring to extract:
    • itemName
    • quantity
    • unitPricePence
  • Implemented formatted output with proper alignment using padEnd()
  • Added total cost calculation with proper decimal formatting
  • Fixed syntax issues (template literal termination)

Key Features

  • ✅ Clean destructuring patterns for better code readability
  • ✅ Proper receipt formatting with aligned columns
  • ✅ Accurate price calculations (pence to pounds conversion)
  • ✅ Total cost summation and display

Questions

Ask any questions you have for your reviewer.

@sedazam sedazam added 📅 Data Flows This work belongs to Data Flows 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Participant to add when requesting review labels Jul 27, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, especially the effort to delve into additional examples of destructuring pattern!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review labels Aug 3, 2025
@sedazam
Copy link
Author

sedazam commented Aug 3, 2025

Thank you, CJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed 📅 Data Flows This work belongs to Data Flows 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants