Assignment with a Returned Value ***

Hello everybody here.
Can someone help my understanding this code issue?

I wil try little bit explain my problem, and you just say if you agry or not, and if our can helkp my understand that.Thanks yo much.
So here we are :frowning: Assignment with a Returned Value)

In this exercise,they say what :

here is code:

var processed = 2;

function processArg(num) {

  return (num + 3) / 5;


// Only change code below this line

processed= processArg(7);

and they say that: processed should have a value of 2 and
You should assign processArg to processed,

My question is, how can I know that processArg = 7?;
From where, how its mat.code for calculate that is 7? if you havnt result???
Of course from first I absolutly not understand that, but after that if I saw solution, I was thinking about that and that maybe in this coding I must going to back on way, like if i have result is " 2 ", so how i was get that? And i know that I was this result need before devide, so now I will need the result multiple, and in coding I had num 5, so I need multiple 2 *5 = 10,and i know that before devided i was need plus 3(+), no now i must minus that, so 10 - 3 is 7,than processArg =7;

BUt question is im not sure, If i going that good, and same qustion sound like from where i can know that? I gradueded from hightschool, but programing is absolutly other way of thinking, but ok, but qustion is : Do I right, and if yes, that mean that JS is all like that? like going to backway. And if im not right, how i can know/learn it?

Like algoritms is go the backway,step be step and understand what happens on the way what u fallow. I hope that somebody here understand my english, sorry for that. But guys, pls tell me and pls explain me that. thanks alot.

I have edited your post to include the challenge link.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

In this function
function processArg(num)

the arguement is a number.

When we call the function, we are going to pass in the number of seven.

If you replace 7 in the expression here then the math works out to be 2
(7 + 3) / 5;
10/5 would result in 2.

That result of 2 is going to be assigned to the variable of processed

Hope that is clearer now.

1 Like

Yes, but problem is that sometime they say something but its just example. :man_shrugging: so how i can do that ? I saw many time exercise like that. So that is why My brain not understanding how make solution.
Thanks you.
I was calculate that we dont know nothing about number 7, because many time it happens my in freecodecamp that it was only example but not task.

For all of these javascript sections, the examples are meant to teach the core concept.
A lot of times, they won’t look the exact same as the challenge where you have to change one small thing.

The goal of the challenges is to make sure you understand the concept with a variety of different examples.

The core concept of this lesson is to learn how to call a function and assign the return value to a variable.

The number 7 was just a random number FCC chose to write the tests for this challenge.
They could have picked any of these numbers and build that challenge around those.

Call the processArg function with an argument of 17
Call the processArg function with an argument of 27
Call the processArg function with an argument of 37

I understand that learning javascript is hard at first.
But my advice would be to come to the forum first and ask questions about what you don’t understand about the problem before looking at the answer.

That way, someone on the forum can help break down the challenge to help you solve it.

1 Like

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