Basic JavaScript - Passing Values to Functions with Arguments

I completed this challenge using the same example from the video, and I understand it. I just found it a little tricky because the instructions didn’t include an example with the - or + in the console part. Also, where does the 3 and 16 come from?

function functionWithArgs(a, b) {
  console.log(a + b);
}

functionWithArgs(10, 5)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

If you look in the lower left corner there is a section called “Tests”. These are tests called behind the scenes on your function to make sure its working as expected. You will see one that calls functionWithArgs with the arguments 1 and 2, and one that calls with 7 and 9, which gives you your 3 and 16 when those numbers are added together and logged to the console in your function.

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