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

Thank you! Stupid mistake on me!