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 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.