Help With: Basic JavaScript: Passing Values to Functions with Arguments

Tell us what’s happening:

I redo everything following hint, video… all the help on the page. The result of the code passed 3 of 4 checks but Im missing this one: “You should call functionWithArgs with two numbers after you define it.”

HEEELP!

Your code so far


function functionWithArgs(x,y){
var sum = x + y;
console.log(sum);
}
functionWithArgs: functionWithArgs(1,2);
functionWithArgs: 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/84.0.4147.125 Safari/537.36.

Challenge: Passing Values to Functions with Arguments

Link to the challenge:

Hello and welcome to the freeCodeCamp community~!

This is not quite the correct syntax for calling a function. As an example:

function hello(name) {
  console.log("Hello, " + name)
}
//now calling it ↓
hello("AgraBaez")

Use return instead of sum
And Remove the console.log
And call the function like
This
functionName(a,b)

Hello~!

This is a function declaration, not a function call. :slight_smile:

Thanks sir
I corrected it
Thanks again

1 Like

image

I think I got confused by reading this part of the problem solution explanation.

Thanks a Million!!!

1 Like