Build a Calculator - Step 2

I have no Idea how im ment to get t to return 2 7

Your addTwoAndSeven function should return the sum of 2 and 7 .

Your code so far


// User Editable Region

function addTwoAndSeven() {
  return ;
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36

Challenge Information:

Build a Calculator - Step 2

You you remember how to add two numbers together in JavaScript?

I thought I did, but evrything I tried and looked up just fails

Can you show code where you tried to add two numbers together?

function addTwoAndSeven( 2,7) {
return ;
}
this was the first thing i tried but deleted it to try other combos

I suggest you review the functions video here again. It shows you examples of returning values.

If you have tried other things, then show us those attempts too so we can help you better :+1:

But I think reviewing that video again would be a good first step

1 Like

I don’t see where you tried to add two numbers together in that code? I see no addition?

//attempt1
function addTwoAndSeven(‘2+7’) {
return (addTwoAndSeven);
}
/attempt 2
function addTwoAndSeven(2,7) {
return (2=7);

//attempt3
function addTwoAndSeven(2,7) {
return 2 + 7;

//attempt4
function addTwoAndSeven() {
addTwoAndSeven(2+7);
return addTwoAndSeven;
}

these are my last tries..
thanks, After rewatching functions (3 times) I at least understand it a little more but Im still completely lost on how to pass the task

Hi,
Great progress! Your were very close on the third attempt. You’re returning the sum of 2 and 7 but you’re doing something extra as well. Take a look at attempt3 and see if you’ve added anything extra.
Good luck!

1 Like