Skip to content

ITP JAN 25 | KatarzynaKazimierczuk | Data Groups | Sprint1 #474

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

Conversation

katarzynakaz
Copy link

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 COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@day-lee
Copy link

day-lee commented Apr 7, 2025

Hi @katarzynakaz Please make sure to add a Needs review label so you it shows up on volunteer's dashboard and you can get a quicker review!

@day-lee day-lee added Needs Review Participant to add when requesting review Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Apr 7, 2025
@day-lee day-lee self-requested a review April 7, 2025 10:41

if (list.length % 2 === 0) {
const median = (list[middleIndex-1] + list[middleIndex]) /2;
return median;
Copy link

Choose a reason for hiding this comment

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

You could return the result of (list[middleIndex-1] + list[middleIndex]) /2 right away instead of assign the value to a median variable as median won't be used again.

@@ -1 +1,11 @@
function dedupe() {}
function dedupe(arr) {
Copy link

Choose a reason for hiding this comment

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

Good job using includes() and push() with new array. There is another solution using Set object As a bonus challenge, can you come up with another solution as well?

return filtered[0]
} else {
//find max
return Math.max(...filtered)
Copy link

Choose a reason for hiding this comment

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

Can you explain why we need to use spread operator with Math.max() here?

@day-lee day-lee added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 7, 2025
@day-lee
Copy link

day-lee commented Apr 7, 2025

Well done! I've added comments. Please let me know if you have any questions.

I don't see sum.js and includes.js in your PR. Did you complete those tasks? Please add all required files for Sprint 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants