Tell us what’s happening:
functionWithArgs(1,2) should output 3
functionWithArgs(7,9) should output 16
what the meaning?
Your code so far
function functionWithArgs(param1, param2) {
console.log(param1 === (1 + 2));
console.log(param2 === (9 + 7));
return functionWithArgs;
}
functionWithArgs(3, 16);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Passing Values to Functions with Arguments
Link to the challenge:
Learn to Code — For Free
You don’t want to hardcode numbers in your function. The numbers are being passed into the function through the parameters param1
and param2
. Those are the numbers you want to add together and then print their sum to the console.
can you give me the example sir, please
Here is an example of a function that uses it’s parameters
function testFun(param1, param2) {
console.log(param1, param2);
}
ronikoswara795:
return functionWithArgs;
I’m confused about this? I don’t think any example or instructions showed this?
system
Closed
February 7, 2024, 11:57am
6
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.