Tell us what’s happening:
Describe your issue in detail here. I am able to produce the desired outcome with my code. But two of the tests are not passing.
-
functionWithArgs(1,2)
should output3
. -
functionWithArgs(7,9)
should output16
.
Your code so far
function functionWithArgs(arg1, arg2) {
var result = arg1 + arg2;
console.log(“Sum:”, result);
}
// Call the function with two numbers as arguments
functionWithArgs(1, 2);
functionWithArgs(7, 9);
function functionWithArgs(arg1, arg2) {
var result = arg1 + arg2;
console.log("Sum:", result);
}
// Call the function with two numbers as arguments
functionWithArgs(1, 2);
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/120.0.0.0 Safari/537.36
Challenge Information:
Basic JavaScript - Passing Values to Functions with Arguments