completed arithmetic lab#33
Open
dcina023 wants to merge 1 commit into
Open
Conversation
KFad11
reviewed
May 11, 2026
|
|
||
| checkRemainder(); | ||
|
|
||
| let max = 20; |
There was a problem hiding this comment.
So this is passing, because the test is expecting to end up with 20 when it checks the value of max, but we're not doing the math in the max variable, we're just shortcutting the math aspect and saying it's just 20 without doing any math
Suggested change
| let max = 20; | |
| const max = Math.max(2, 20, 5, 1, -6, -Infinity) |
That variable would suffice the test output AND be doing the math itself. You have that in the console.log() beneath the "hard coded" variable declaration.
Despite the small misstep, I feel like we still understand the concept the lab was showcasing. Remember to slow down, understand the ask of the instructions, if anything is a little unclear, ask away.
KFad11
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completed arithmetic lab. The most difficult part of the lab for me was test 3. I struggled with the test recognizing num3 variable. I tried declaring it in various ways with let, const, var, outside the function, inside the function, etc. Just to figure out there was a small syntax error in the previous random variable. From my understanding, this made the test stop running....so it therefore didn't recognize the variables I was declaring num3 and num4. I could be wrong, but that's what I got from researching.