Skip to content

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 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 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 all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 3, 2025
@sedazam
Copy link
Author

sedazam commented Aug 3, 2025

Thank you, CJ

@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check its title is in the correct format, and update it.

Reason: Sprint part (Module-Data-Flows) doesn't match expected format (example: 'Sprint 2', without quotes)

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 all review comments have been addressed. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants