Why am I failing the tests though correct value gets displayed in console?


Hi all, I’m doing this assignment, but I think the test was written incorrectly. Thought I’d double check. My implementation (bolded) should be correct (it gives me the right value) but it keeps failing the test for the use of destructuring.

today: 77.5,
tomorrow: 79

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

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

hi @pc328,
the ‘use strict’ statement is restricting you from accessing AVG_TEMPERATURES. They want you to destructure a different reference.

1 Like

I changed your category to JavaScript and added an actual description to your topic title instead of a url.

Thank you! Stupid mistake on me!