Skip to content

London | May-2025 | Ikenna Agulobi | Data Groups | sprint-1 #575

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 21 commits into
base: main
Choose a base branch
from

Conversation

ike-agu
Copy link

@ike-agu ike-agu commented Jul 10, 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_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist##

Briefly explain your PR.
This PR includes my completed exercises for Sprint 1 - Data Groups module.

###The exercises included in this PR:###

1- Fix
2- Implement
3- Include

Questions

Ask any questions you have for your reviewer.
Hi!, I don’t have a question at the moment, but I just wanted to let you know that I wasn’t able to complete the stretch project because I’m currently focusing on catching up with the mandatory tasks to stay on track. Thanks!

ike-agu added 19 commits July 10, 2025 11:32
…st and to return null if array has no numbers
@ike-agu ike-agu added the Needs Review Participant to add when requesting review label Jul 12, 2025
Copy link

@MorganDavid MorganDavid left a comment

Choose a reason for hiding this comment

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

Well done! I've left a few questions

}
//Filtering out numbers from the array without changing the original array. Creates new array filteredNumbersOnly!
const filteredNumbersOnly = list.filter(
(element) => typeof element === "number" && !isNaN(element)

Choose a reason for hiding this comment

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

This is correct! Do you understand why we also need !isNaN here?

Copy link
Author

Choose a reason for hiding this comment

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

Yes! We need !isNaN in my function so that it filters real usable numbers and ignore anything that is not a real number like 'NaN".

Comment on lines +1 to +4
function dedupe(arr) {
const newArray = [... new Set(arr)]
return newArray;
};

Choose a reason for hiding this comment

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

have you tested this? does it run or is there a syntax error?

Do you understand how the Set works?

Copy link
Author

Choose a reason for hiding this comment

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

I tested my code and it does work.
Set() is a JS object which stores collection of unique values. For instance, in my code "new Set(arr) " filters out any duplicates in the array and creates a set of new values with no duplicates. Then the spread operator converts it back to a new array .

Comment on lines 8 to 15
function calculateMean(list){
let total = 0;

for(const item of list){
total += item/3
}
return total;
}

Choose a reason for hiding this comment

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

What happens if the array contains more than 3 numbers? does it still correctly calculate the mean?

Copy link
Author

Choose a reason for hiding this comment

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

If the array contains more than 3 numbers, the code will still run but wouldn’t work as we expect because to get the Mean we need to use the length of the array.
So I've updated my code to get the Mean of the array regardless of it's length.

@MorganDavid MorganDavid added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 12, 2025
ike-agu and others added 2 commits July 12, 2025 19:44
@ike-agu
Copy link
Author

ike-agu commented Jul 12, 2025

Hi @MorganDavid , Thank you for taking the time to review my PR and for your valuable feedbacks.
I've implemented changes you pointed out. Please could you take a look. Thanks!

@ike-agu ike-agu added the Needs Review Participant to add when requesting review label Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants