I’ve been stuck on this challenge for a day or so, I think I understand the reassignment part, however I looked for the hint and totally do not understand the string prototype thing.
I think thats the step i’m missing?
Your code so far
const AVG_TEMPERATURES = {
today: 77.5,
tomorrow: 79
};
function getTempOfTmrw(avgTemperatures) {
"use strict";
// change code below this line
const tempOfTomorrow = AVG_TEMPERATURES
const {today , tomorrow} = tempOfTomorrow;
// change this line
// change code above this line
return tempOfTomorrow;
}
console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.
The issue is with this line. When writing this statement, consider the following syntax:
const {value wanted in object : variable to assign it to} = object where it is located
Okay I see that I am supposed to use tomorrow as the value however when I do this my code does return 79, however it is not accepted as deconstruction with reassignment, can you tell me why this is?
[quote=“spreti, post:3, topic:232980”]
and when I use tomorrow as my value,
it does return 79, however it does not consider this destructuring can you give me more insight on this?