Birmingham | ITP Jan 2026 | Arunkumar Akilan | Sprint 1 | Data Groups#992
Birmingham | ITP Jan 2026 | Arunkumar Akilan | Sprint 1 | Data Groups#992arunkumarakilan wants to merge 6 commits intoCodeYourFuture:mainfrom
Conversation
jayshreehajgude2012
left a comment
There was a problem hiding this comment.
check dedupe(list) function for empty array data validation.
check indentation.
Thanks for the feedback! I checked the |
| @@ -1 +1,17 @@ | |||
| function dedupe() {} | |||
| function dedupe(list) { | |||
| if (list.length=== 0) | |||
There was a problem hiding this comment.
Do you need this special case? If you removed the if (list.length === 0) check here, what would break?
| ("array with no duplicate should return copy of original", ()=>{ | ||
| let list = [1,2,4,6,9,8]; | ||
| expect(dedupe(list)).toEqual([1,2,4,6,9,8]); |
There was a problem hiding this comment.
"copy" is an interesting word here - are you testing that it returns a copy? If your function just did return list; would your test start failing?
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
Completed Sprint 1 – Data Groups coursework.
Implemented and tested the following exercises:
Fix
median.jsand ensured all tests pass.Implement
dedupe– removes duplicate values from arraysmax– returns the largest number in an array while ignoring non-numeric valuessum– calculates the total of numeric values while ignoring non-numeric valuesRefactor
includesfunction to use afor...ofloop.All provided Jest tests are passing.
The stretch exercise (Advent of Code) is not included in this PR.
Questions
None at the moment.