ES6: Destructuring challenge

today: 77.5,
tomorrow: 79

function getTempOfTmrw(avgTemperatures) {
“use strict”;
// change code below this line;
const {tomorrow : tempOfTomorrow} = AVG_TEMPERATURES; // change this line
// change code above this line
return tempOfTomorrow;


console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79

this is my code, I get same error with
" // running tests

destructuring with reassignment was used

// tests completed"

Help will be very much appreciated :slight_smile:

you are using the global object, when a function has a parameter you should be using that one

I figured that out just 30 sec ago :smiley:

SLow minded after 9pm lol haha

I moved your question to its own topic because you were asking a question related to your own code for a challenge and were not answering the OP of the other thread. It is always best to create your own thread for you specific question(s). Also, it is advisable to use the Ask for Help button on the challenge, so it auto-populates with your current code and the challenge url.

Thank you.