You don’t want to hard code these numbers here. functionWithArgs(1,2)
Instead you want to come up with two parameter names.
Like mentioned in the lesson they act like placeholders for the actual values used later.
Since we are dealing with numbers your parameter names can be num1, num2 for example. or n1, n2.
You want to choose names that actually make sense in the context of the problem.
Writing something like this wouldn’t make much sense.
function functionWithArgs(cake,frog)
Once you have chosen your parameter names you should get something like this.
function functionWithArgs(num1, num2){
console.log()
}
You have the console.log part write but what is inside the parenthesis needs to change.
The instructions ask us to output the sum.
Sum means addition.
You need to write an expression where you take parameter name 1 and add that with parameter name 2.
function functionWithArgs(num1, num2){
console.log(//write an expression here that adds num1 and num2)
}
Once you write that expression, then you can call the function.
This first part is right but what is in the parenthesis is not correct.
FCC instructions:
Call the function with two numbers as arguments.
It makes sense to use two numbers in our function call because of the parameters that we set here. function functionWithArgs(num1, num2)
Choose two numbers that will go inside the parentheses of that function call.
Everytime the function is called it will execute the code inside the function.
//the computer will execute the expression you will write
console.log(//write an expression here that adds num1 and num2)