Basic JavaScript - Passing Values to Functions with Arguments

Tell us what’s happening:
Describe your issue in detail here.
Why is this solution not working? can anyone explain on this, please…
Your code so far

function functionWithArgs(test1, test2) {

return test1 + test2;

}

let result1 = functionWithArgs(1,2);

console.log(result1);

let result2 = functionWithArgs(7,9);

console.log(result2);

function functionWithArgs(test1, test2) {
  return test1 + test2;
}
let result1 = functionWithArgs(1,2);
console.log(result1);

let result2 = functionWithArgs(7,9);
console.log(result2);

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:

In this case, the function is expected to print the result to console on it own.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.