Passing Values to Functions with Arguments

Tell us what’s happening:

Your code so far

// Example
function ourFunctionWithArgs(a, b) {
  console.log(a - b);
ourFunctionWithArgs(10, 5); // Outputs 5

// Only change code below this line.
function functionWithAgrs(a,b + c,d) { 
  console.log(1,2 + 7,9)
functionWithAgrs(1, 2); // Output 3                                 functionWithAgrs(7, 9); // Output 16              

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36.

Link to the challenge:

This isn’t how you declare a function that accepts arguments. The list between the () cannot contain a + sign. Usually it’s just a comma-separated list of names. Look at the example. It declares a function that accepts two arguments a and b. The challenge wants you to make a function that also accepts two arguments.

Again looking at the example function, it takes the two arguments and subtract one from the other, then print the result. You want to do the same, except you need to compute for the sum of the arguments.

You have a typo here. Agrs should be Args.

1 Like