Basic JavaScript - Passing Values to Functions with Arguments

Tell us what’s happening:
Describe your issue in detail here.
when I attempt to run the code it ticks off all task it says the output for (1,2) needs to be 3 but 3 appears in the console?

Your code so far

function functionWithArgs(number1, number2) {
  console.log(1+2); 
  console.log(7+9);
}
functionWithArgs(3,16)
 

Your browser information:

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

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

1 Like

You are not using the function parameters

Hey , apologies , are you able to explain further on what improvements to make?

You need to use number1 and number2 in your code instead of hard-coded numbers. You need to code the function so that it works for any inputs.

1 Like

Thank you very much for your time & patience I will run that now. :blush: )

1 Like

Tell us what’s happening:
Describe your issue in detail here.
Hey, I am still really struggling I cannot figure this code no matter how many videos or Hints ive trialed and error the past hour I am at a loss!
Your code so far

function functionWithArgs(equation1, equation2) {

  console.log(equation1 + equation2);
}
functionWithArgs()
functionsWithArgs()



Your browser information:

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

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

This part is right.

Here though…

Two problems

  1. You mispelled the function name the second time

  2. You need add arguments to these function calls

2 Likes

:+1: amazing thank u jeremy

1 Like

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