I have a question and not looking for a solution to the code printed below, the example is just there for reference.
I would like to know if it's possible to add multiple arguments from different functions into one function containing all the parameters.
Basically, I would like to know how to write this code correctly.
I LIKE TO STATE I AM NEW TO JAVASCRIPT AND MAY NOT KNOW HOW TO WRITE THESE QUESTIONS OUT CORRECTLY ON OVER-STACK FOR YOU PROFESSIONAL TO ANSWER.
This is a fake example code
Step 1: I have a main function that holds all the parameters, x, y, z.
function sumNum(x, y, z) {
return (x * y) + z;
}
Step 2: Question - What do I need to add within the brackets as an argument to link the X parameter in the above function in step 1.
function num1() {
sumNum()
}
Step 3: Question - What do I need to add within the brackets as an argument to link the Y parameter in the above function in step 1.
function num2() {
sumNum()
}
Step 4: Question - What do I need to add within the brackets as an argument to link the Z parameter in the above function in step 1.
function num3() {
sumNum()
}
I understand that you need to call the arguments in the order you have them set as parameters, but I want to know if there are other ways of writing this code to get the same results.