.Assignment with a returned value

This may be a little long winded. But here it goes.

let processed = 2

function processArg(num) {
return (num + 3) / 5;

//only change code below this line

processed = processArg(7)

my thoughts and questions -
that is the correct answer. But I don’t know why. Where did the 7 come from? and then before that, the variable “processed” is assigned the value of 2.
and when I tell the function to return 3 divided by 5 , well that just seems weird to me. None of it makes sense.

I added spoiler tags.

I’m looking for the challenge link before I can answer with context.

Edit, found it: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value

That shouldn’t be the case. The initial value that it was set to at first is processed = 0.

The idea behind this challenge is to change the value stored in processed by calling the function and using the return value.

The instructions picked the number (7) they want you to use so that the test knows vhan output value to look for.

1 Like

lol @ Myself. Then what I think now is that I spent way too much time in thought about it. I over-thunk it. I appreciate your time with this. Thanks.

No harm in over thinking. I’m glad I could help!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.