keyohh
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
Trying to understand how i could have known this
Yeah i see that now in the console log. Still don’t 100% get why i had to use arr.push instead of testArr. Feel like they should have let you know somewhere. In my mind was just looking at arr as the array (testArr) parameter. So i was thinking testArr was supposed to be plugged in there.
6 replies
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
learning JS with FCC, trying to understand something.
Being new is hard, appreciate the help lol.
21 replies
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
learning JS with FCC, trying to understand something.
Okay, thanks. I get it now.
21 replies
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
learning JS with FCC, trying to understand something.
So the 8 isn’t asked to be shown just stored directly into “sum”?
21 replies
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
learning JS with FCC, trying to understand something.
Yeah, that’s the part i’m having a little trouble understanding. It’s obviously wrong but in my head i keep saying okay it knows it’s 8 why not show 8 on the addFive()
21 replies
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
learning JS with FCC, trying to understand something.
And since there isn’t a return we get the undefined. Because it doesn’t know what to console log?
21 replies
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
learning JS with FCC, trying to understand something.
Ahh okay. Yeah i see now. The sum is global which allows anything to use it and doesn’t change it to local just because a function used it.
21 replies
KPCKevin Powell - Community
•Created by keyohh on 7/10/2023 in #front-end
learning JS with FCC, trying to understand something.
I’ve yet to see the arrows. Just kinda wondering how if the sum starts off globally and then once it runs through the first function the returned value for that should be local to that function? If so how does it take that value (3) and add 5 more in the next function for it to be 8.
21 replies