Basic JavaScript - Passing Values to Functions with Arguments

Tell us what’s happening:
Describe your issue in detail here.

I get this answer, even though my code does what it is supposed to do:

// running tests
functionWithArgs(1,2) should output 3.
functionWithArgs(7,9) should output 16.
// tests completed

  **Your code so far**  // Here's my code:
function functionWithArgs(a, b) {
return a + b;
}

functionWithArgs(1, 2);
functionWithArgs(7, 9);
  **Your browser information:**

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

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

Create a function called functionWithArgs that accepts two arguments and outputs their sum to the dev console.

So log rather then return.

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