Tell us what’s happening:
Describe your issue in detail here.
Your code so far
Good day friends, kindly help me on this challenge. The system pass me on other three only fail me on second line, either I put any challenge there it wont pass. So I think it has somethings to do with line one. Thanks.
function functionWithArgs(a , b) {
console.log(1 + 2);
console.log(7 + 9)
}
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
Your code just has some random numbers going on in there.
You just need one console.log inside your function and in that console.log you add your two parameters. With your code the two parameters are a(the number 3 argument) and b (the number 16 argument . The parameters a and b represent the arguments 3 and 16 so you add a + b .
I dont know if it is nessesarry or not but I clear things more out, for my own understanding as practice and as helpful hand for others.
We’ve learned that a function we create can have one or more parameters. In this challange we should create a function with the name functionWithArgs. To make our function existent, we have to create the function by writing out function functionWithArgs. Our task is to create a function with two paramenter, which would be in this case a, b:
function functionWithArgs(a, b) {
}
now we have to build the body of the function by filling out the requierments of the task.
Create a function called functionWithArgs that accepts two arguments and outputs their sum to the dev console.
we can do it by writing console.log(a + b) which would print out the summation of the two parameters. If we done it correctly, you should be able to fullfill the second task and write out the function with two giving arguments you can choose by your own.