Repository navigation
London | 26-ITP-Sep | Mars Adesina | Sprint 3 | Refactoring Dead Code - #1745
marscancode wants to merge 2 commits into
Conversation
iscmiguelsamaniego
left a comment
There was a problem hiding this comment.
Excellent work overall! All previous exercises and tests are clean, accurate, and well-implemented. For the final exercise, please review the duplicate variable declaration and complete the frequency map logic for countAndCapitalisePets. Great progress so far!
There was a problem hiding this comment.
Excellent work start on structuring the function and array operations.
Quick question:
countedPetsStartingWithH is declared twice, and the function currently returns an empty object. How might you iterate through the array to populate the frequency map?
There was a problem hiding this comment.
Hi , Thanks for reviewing my work. I'm a little unsure about your feedback regarding the duplicate declaration and the empty object. I moved the countedPetsStartingWithH declaration rather than keeping both declarations, and my function already had the .forEach() loop to populate petCount. When I run my current code, it returns { HAMSTER: 3, HORSE: 1 }. Could you clarify what I need to change or which part I may have misunderstood? Thanks!
Learners, PR Template
Self checklist
Task code
CYF-1066
Changelist
Refactored the code to remove any unused code that was not contributing to the final function output for sayHello and countAndCapitalisePets and ran the code to check that the final output matched the intended output.