So I’ve been having some issues with homework, and I’ve tried various methods trying to find my way around this but can’t seem to find the correct way. It should be simple for those who are knowledgeable in JavaScript as this is what’s currently being taught in my intro course.
Instructions:
Complete the function foo below. Make it take three parameters and return the result of multiplying the first two and adding the third.
(code given):
function foo(){
}
var n = parseInt(process.argv[2]);
var r = foo(n,n*1,n+2) + foo(n+4,n+5,n+6);
console.log(r);
I understand that the parseInt method is used to gather input, that foo is my function.
I don’t understand how to add parameters correctly, where to add them inside or outside of the function, and how to display them how the instructions direct us to.
Help would be appreciated, thanks in advance!