-
-
Notifications
You must be signed in to change notification settings - Fork 147
Glasgow | ITP May 25 | Mirabelle Morah | Data groups | Sprint 1 #579
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.
Good work on this - I have one question about the mean.js file, it doesn't seem implemented. Other than that, good work on these tasks
} | ||
|
||
// If even number of elements, this returns the average of the two middle elements | ||
return (sortedNumbers[middleIndex - 1] + sortedNumbers[middleIndex]) / 2; | ||
} |
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.
Good solution
function dedupe(list) { | ||
return [...new Set(list)]; | ||
} | ||
console.log(dedupe(['a','a','b','c','c'])); // returns ['a', 'b', 'c'] |
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.
Good use of built-in Set feature
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.
Thank you
} | ||
// If the sum is negative, return 0; otherwise, return the sum | ||
const total = filterList.reduce((acc, curr) => acc + curr, 0); | ||
return total; |
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.
Good use of reduce function
// Write a function which takes an array as a parameter | ||
// and swaps the first element with the last element | ||
|
||
function swapFirstAndLast(arr) {} |
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.
Is this finished yet? Did you mean to commit this file here?
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.
Thanks for your review and yes please, you can ignore the prep folder and no action is needed here. It is for my draft practice only and not mandatory.
In the prep section for the entire module it asks us to create a prep directory to practice. So for every sprint, I have a prep folder where I create random tests, delete stuff and just practice there. :)
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.
OK, that's fine. You are complete with this sprint, then. Good job!
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.
Sprint complete.
// Write a function which takes an array as a parameter | ||
// and swaps the first element with the last element | ||
|
||
function swapFirstAndLast(arr) {} |
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.
OK, that's fine. You are complete with this sprint, then. Good job!
Learners, PR Template
Self checklist
Changelist
Worked on problems
Questions
Nil