In a real world case, you would never see that global AVG_TEMPERATURES. Your function should almost never be aware of any variables outside of itself.
But… Your function is getting a parameter. Can you see a way to use THAT, instead?
Side note, most of the questions you’ll be asking on the forum have already been asked and answered. I field this one maybe once a week. Word of advice? Search the forums.
I see that you’re using “:” into your braquet. In this way, it just look like you’re trying to set a object with the “tomorrow” property and tempOfTomorrow ( undefined ) as value.
Well, yes and no @NastYo – take a look at the code. The return tempOfTomorrow is something that is set in the provided code, you need to create a variable with that name. The format used is accurate, it says “get tomorrow AS tempOfTomorrow FROM avgTemperatures”.
Bear in mind, the only part of the function you’re allowed to alter is between the
Yea you’re right. Then in this case, I don’t realy understand why should he use the destructuring assignment. My first answere pointing on how to use destructuring.
But as you mentioned, it’s not what he need. Just set a new variable with the data(average), then hiswork and return this new variable.
Note also that here you are using the global variable when you should be using the function parameter - even with this you don’t pass the “destructuring assignment was used” test