The "Run the Tests" button is not running

Tell us what’s happening:
I’m pretty sure that I wrote the code correctly and checked for syntax errors, but when I click the “Run the Tests” button it won’t run.

  **Your code so far**

function functionWithArgs(1, 2) {
console.log(1 + 2);
}
function functionWithArgs(7, 9) {
console.log(7 + 9);
}
functionWithArgs(1, 2);
functionWithArgs(7, 9);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

Challenge: Passing Values to Functions with Arguments

Link to the challenge:

Are you not getting this in the console:

SyntaxError: unknown: Unexpected token (1:26)

1 | function functionWithArgs(1, 2) {
| ^
2 | console.log(1 + 2);
3 | }
4 | function functionWithArgs(7, 9) {

You have a couple of problems there:

  1. You have declared the same function twice.
  2. You have literal values (like 1 and 2 or 7 and 9) for your parameter names - that is illegal in JS - you need proper JS variable names.
  3. You need to use those parameters in the function.

When I fix those three things, not only does the “Run the Tests” button work, but the code passes. Right now it is not running because what you have is not valid JavaScript.

1 Like

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