Skip to content

completed arithmetic lab#33

Open
dcina023 wants to merge 1 commit into
learn-co-curriculum:masterfrom
dcina023:master
Open

completed arithmetic lab#33
dcina023 wants to merge 1 commit into
learn-co-curriculum:masterfrom
dcina023:master

Conversation

@dcina023
Copy link
Copy Markdown

@dcina023 dcina023 commented May 4, 2026

Screenshot 2026-05-04 at 7 36 50 PM

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.

Comment thread index.js

checkRemainder();

let max = 20;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants