Learn Intro Javascript Build a Pyramid Step 55

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.

  1. I understand, this step in particular is asking to declare a function addTwoNumbers.
  2. It’s asking to use a return statement that does not use hardcoded values, so we cannot use integers inside the function.
  3. Declare a sum variable (this is probably my biggest problem so far and my biggest misunderstanding for this step).
  4. sum needs to call addTwoNumbers
  5. The arguments inside addTwoNumbers are 5 and 10
  6. 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.

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

Thanks for the response. Eventually arrived at the solution after slowly going over those instructions again and again and probably just remembering the solution.

This struggle is the genuine learning. This will make your programming muscles stronger.

If you ever get stuck please come to the forum and ask any questions you have

It sounds like you are doing the old curriculum

I would suggest doing the current JS section which is in the Full Stack Developer Certification.

It moves at a much slower pace so you can feel better about the fundamentals.

I came to fCC a couple years ago and finished maybe 2 of the projects in HTML / CSS course. I’m just a bit more familiar with the old curriculum - but yes. Certainly looked at the new content and so far seems much better for absolute beginners.