Passing Values to Functions with Arguments: can’t work it out

So I’m really stuck on this, I’ve checked the forum and online. For some reason all I get online is to use call() to call the function but as I haven’t been introduced to it I’m sure there’s an easier way.

I don’t get how to output what I need to the dev console or how to call the function. Or if I’m putting the right things for the perameters.

function functionWithArgs(one, two){
console.log(functionWithArgs);
functionWithArgs(1 + 1);
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15

Challenge: Passing Values to Functions with Arguments

Link to the challenge:

Honestly I think you should go back an exercise and do this one first, it shows you how to call a function

1 Like

one and two are the function parameters, you never use them

You are logging the function itself, but that’s not what you should log

Do not call the function inside itself

1 Like

Okay I’ve got this now which isn’t right but I’m not trying to call the function inside itself now.

function functionWithArgs(one, two){

console.log(one + two);

}

functionWithArgs(3 + 4);
1 Like

Ignore that message I worked it out. Think I understand but I’m gonna play with this in codepen for a bit untill I’m sure. :smiley:

1 Like

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