Skip to content

Manchester | 26-ITP-May | Abdu Hassen | Sprint 1 | Destructuring - #519

Open
Abduhasen wants to merge 1 commit into
CodeYourFuture:mainfrom
Abduhasen:feature/destructuring
Open

Manchester | 26-ITP-May | Abdu Hassen | Sprint 1 | Destructuring#519
Abduhasen wants to merge 1 commit into
CodeYourFuture:mainfrom
Abduhasen:feature/destructuring

Conversation

@Abduhasen

@Abduhasen Abduhasen commented Aug 6, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

destructuring of codes

Questions

@Abduhasen Abduhasen added 🐇 Size Small Around an hour 📅 Sprint 1 Assigned during Sprint 1 of this module Module-Data-Flows The name of the module. Optional This is an optional task to be attempted once trainees have completed the core tasks labels Aug 6, 2026
@Abduhasen Abduhasen changed the title Manchester | 26-ITP-May | Abdu Hassen | Sprint 1 | Data flow Manchester | 26-ITP-May | Abdu Hassen | Sprint 1 | Destructuring Aug 6, 2026
@Abduhasen Abduhasen added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 8, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 8, 2026
@Abduhasen
Abduhasen force-pushed the feature/destructuring branch from 7e741e1 to 3e564c8 Compare August 8, 2026 16:03
@Abduhasen Abduhasen changed the title Manchester | 26-ITP-May | Abdu Hassen | Sprint 1 | Destructuring Manchester | 26-ITP-May | Abdu Hassen | Sprint 1 | Destructuring Aug 8, 2026
@github-actions

This comment has been minimized.

@Abduhasen Abduhasen added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Optional This is an optional task to be attempted once trainees have completed the core tasks labels Aug 8, 2026
favouriteFood: "Spinach",
};

let { name, age, favouriteFood } = personOne;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would introduce the variables in the "global" scope (scope outside the function).

We could de-structure the parameters too.

},
];
function houseGryffindor(hogwarts) {
for (let individualHogwarts of hogwarts) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Normally, we can use const to declare the loop variable in a for-of or for-in loop because we usually don't need to reassign value to the variable.

  • We could also use de-structure syntax in a for-of loop as for (const { key1, key2, ... } of objects) { ... } where key1, key2, ... are the property names.

console.log("Total: " + (grandTotal / 100).toFixed(2));
}

valueProperty(order);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you call this function multiple times in a row (even with the same argument), you may discover a bug in your code.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Flows The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 🐇 Size Small Around an hour 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants