-
-
Notifications
You must be signed in to change notification settings - Fork 220
Birmingham | 25-ITP-Sep | Joy Opachavalit | Sprint 1 | Sprint-1 #800
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
Conversation
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 missed updating Sprint-1/implement/sum.js and Sprint-1/implement/sum.test.js.
|
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.
Changes look good.
| } | ||
|
|
||
| // Sort the numbers in ascending order (don't mutate original array) | ||
| const sorted = [...numbers].sort((a, b) => a - b); |
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 it necessary to clone numbers?
| expect(result).toEqual(original); // same values | ||
| expect(result).not.toBe(original); // different reference |
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 job.
| expect(findMax(["hey", 10, "hi", 60, 10])).toBe(60); | ||
| expect(findMax([5, "hello", 15, null, 10, undefined])).toBe(15); | ||
| expect(findMax([1, "test", 2, NaN, 3])).toBe(3); |
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.
Could also include strings that can usually be safely converted to numbers (e.g., "100", "3e2") to ensure the function can properly ignore values that are not numbers.
Learners, PR Template
Self checklist
Changelist
-Completed all excercises in Sprint-1