I'm having issues with passing values to Function

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.

functionWithArgs(1, 2);{
  console.log(1 + 2);
}
FunctionWithArgs(7, 9);{
console.log(7 + 9);  
}

Your browser information:

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

Link to the challenge:

@Rosie2610

  1. I do not see functionWithArgs defined before it is used
function functionWithArgs(a, b) {
  console.log(a + b);
}
  1. Be careful the second function is different from the first as the F is capitalized
    Javascript is a case sensitive language therefore the function below is a different function from the previous one
function FunctionWithArgs(a, b) {
console.log(a + b);  
}
  1. the only function defined is in the do not change above this line, so that is the only one that will execute properly
function ourFunctionWithArgs(a, b) {
  console.log(a - b);
}
  1. no semicolons in the declaration of the function between the name and open curly such as
    FunctionWithArgs(7, 9);{
    But yes when you make the call as a statement, close with a semi colon

What happened to ourFunctionWithArgs?

Let me know if this clarifies things.

Cheers.
-WWC

1 Like