-
-
Notifications
You must be signed in to change notification settings - Fork 112
GLASGOW | May-2025 | Taras Mykytiuk | Module-Data-Flows | Sprint_1 #248
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi taras. You've found some good solutions to these tasks, but they are slightly missing the goal of this sprint, which is about learning object destructuring. Can you have another look at this?
@@ -6,7 +6,10 @@ const personOne = { | |||
|
|||
// Update the parameter to this function to make it work. | |||
// Don't change anything else. | |||
function introduceYourself(___________________________) { | |||
function introduceYourself(person) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal in this task is to use object destructuring to solve the challenge. Can you see how to change only the parameter here (person
) such that the original function works?
Hint: Don't create new variables, like accessing person.name
.
@@ -70,3 +70,24 @@ let hogwarts = [ | |||
occupation: "Teacher", | |||
}, | |||
]; | |||
|
|||
function displayGryffindor(hogwarts) { | |||
for (const person of hogwarts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment to task 1 - instead of getting a person
and then accessing a property like .house
, can you use object destructuring in the for-of loop?
} | ||
|
||
// number of digits can be calculated from logarithm with base 10 | ||
function numberDigitsQuantity(number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be overthinking this task - we don't need something that is absolutely perfectly formatted, rather we are trying to build a function that can incorporate object destructuring to avoid having to keep accessing properties on the objects
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
All exercises from sprint 1 done.
Questions
Ask any questions you have for your reviewer.