-
-
Notifications
You must be signed in to change notification settings - Fork 195
West Midlands | ITP-Sept-25 | Mustaf Asani | Sprint 2 | Data groups coursework #934
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?
West Midlands | ITP-Sept-25 | Mustaf Asani | Sprint 2 | Data groups coursework #934
Conversation
…n implement folder
…works as expected
…in querystring test suite
in querystring file and refactored tally.js to use itemcount
cjyuan
left a comment
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.
You are doing great. tally.js could still use some improvement.
| let n = 0; | ||
|
|
||
| while (inputArray.length > 0) { | ||
| itemCount = 0; |
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.
itemCount is used only inside the while loop, so it is best practice to declare the variable here (in the block { ... } where the variable is being used)
|
|
||
| while (inputArray.length > 0) { | ||
| itemCount = 0; | ||
| const tempArray = []; |
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.
Can your code work without using tempArray?
| i--; | ||
| } | ||
|
|
||
| if (itemCount > 0) { |
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 check necessary? Under what circumstances will itemCount be 0 or less?
Learners, PR Template
Self checklist
Changelist
Completed the debug, implement and interpret tasks