Tell us what’s happening:
Describe your issue in detail here.
how do i call the function
**Your code so far**
function functionWithArgs(one, two){
console.log(one + two);
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
Challenge: Passing Values to Functions with Arguments
Link to the challenge:
The description says:
Then we can call testFun
like this: testFun("Hello", "World");
.
So, you could call your functions like:
functionWithArgs('apple', 'jack')
I’m afraid I still don’t understand.
my problem: “You should call functionWithArgs
with two numbers after you define it.”
my code:
function functionWithArgs(one, two){
console.log(one + two);
}
functionWithArgs(‘6’, ‘9’);
functionWithArgs(‘4’, ‘8’);
OK, I didn’t read the thing closely but just asked your question.
My example was calling the function with strings:
functionWithArgs('apple', 'jack')
You are also calling it with strings:
functionWithArgs(‘6’, ‘9’);
But it says that you want to call it with numbers. If you remove the quote marks ('
), those will be numbers instead of strings.
thank you! sorry for the inconvenience
It’s no inconvenience. That’s why we’re here. I volunteer my time because this is relaxing. As long as people are working hard and have a good attitude, I enjoy this.
Keep up the good work.
system
Closed
April 25, 2022, 5:57am
7
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.