This is my second run through of this project as there were many steps where I stumbled into several walls and just could not understand the instructions and cheated myself by looking at solutions and that provided a very shakey foundation for basic fundamentals.
I understand maybe 50-60% of what I need to do, but not quite getting the final execution.
- I understand, this step in particular is asking to declare a function addTwoNumbers.
- It’s asking to use a return statement that does not use hardcoded values, so we cannot use integers inside the function.
- Declare a sum variable (this is probably my biggest problem so far and my biggest misunderstanding for this step).
- sum needs to call addTwoNumbers
- The arguments inside addTwoNumbers are 5 and 10
- And then log the sum variable.
function addTwoNumbers(a, b) {
return a + b;
}
const sum = addTwoNumbers(5 + 10);
console.log(sum);
And otherwise, this is the code I produce once I take the training wheels off and low and behold - it does not pass! A lovely slap in the face.
So far, I’m getting a little better with understanding how to declare functions having watched a few youtube videos and seeing other examples and such with return statements written inside. I still however having a lot of difficulty following the exact steps as soon as I remove the fCC solution.