888Owl
October 1, 2018, 3:42am
1
I am having an issue with this I can get the first answer easily but no matter what I try it won’t fulfill the second parameter of the challenge, any advice? also, this is the line of code I changed it to
const {tomorrow:tempOfTomorrow} = AVG_TEMPERATURES; // change this line
I did try a lot of variations for making today work in case that was the problem but I’m truly not sure anymore
thank you for your time in advance
You are using the argument which is not in the function,You can change the AVG_TEMPERATURE to lower case which is used in the function.
1 Like
888Owl
October 1, 2018, 3:53am
3
thank you, i sometimes take the examples to literally and shoot myself in the foot
More explanation : There is a difference between an argument and a parameter .
AVG_TEMPERATURES
is an argument of getTempofTmrw()
function call.
When working with data inside a function, it’s not the argument
to a function call that should be used, but the parameter inserted in the function: in this case getTempOfTmrw()
So, what is it here?
It’s up to you to find it.
Here are more explanations.
Many documentation and tutorials use the words parameters and arguments interchangeably and it’s confusing.
And here is an example that shows you the difference between the two:
function myFunction(parameter) {
/* parameter gets its value from argument variable
passed to myFunction() call. */
/* inside a function, the variable parameter
should be used, not argument. */
/* i.e. You should not use argument variable inside the function */
console.log(parameter) /* output: This is an argument when
it is passed into myFunction call, and parameter
when used inside the function */
}
...
var argument = "This is an argument when passed into
myFunction call, and parameter when used inside the function.";
myFunction(argument);