Tell us what’s happening:
Describe your issue in detail here.
I feel like this is correct, but obviously isn’t , could someone please tell me where I’m going wrong, thank you.
Your code so far
function functionWithArgs(1, 2) {
console.log(1, 2)
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.141 Safari/537.36
Challenge: Passing Values to Functions with Arguments
Link to the challenge:
you should give parameter names not literal values in a function declaration. values are given when you call a function then those values are passed to these parameters. you can access them using parameter names just like variables. and you should call the function with its name along with parentheses and the arguments
1 Like
Finally got it in the end, thank you for pointing out where I was going wrong.
1 Like
Hello, I am trying to complete the Challenge: Passing Values to Functions with Arguments- and am having a very hard time. an someone please tell me what I am doing wong?
my input:
function functionWithArgs(a, b, c, d) {
console.log(1 + 2);
console.log(7 + 9);
}
functionWithArgs(1, 2); //Outputs 3;
functionWithArgs(7, 9); //Outputs 19;
I am getting this as the response:
function functionWithArgs(a, b, c, d) {
console.log(1 + 2);
console.log(7 + 9);
}
functionWithArgs(1, 2); //Outputs 3;
functionWithArgs(7, 9); //Outputs 19;
// running tests
functionWithArgs(1,2) should output 3.
// tests completed
// console output
3
16
3
16
3
16
3
16
3
16
3
16
If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.
Thank you.