ES6: Challenge Destruct to Assign Var from Obj buggy?

ES6: Challenge Destruct to Assign Var from Obj buggy?
0

#1

Hi. I have tried to complete this challenge a few different ways but I ultimately end up with the same result:
// running tests
destructuring with reassignment was used
// tests completed
I ran through the code using Chrome dev tools as well, and the console printed 79, with no errors (screen shot). I ran into this issue with a previous challenge and so I followed the same suggestions (clear cache, cookies, reload browser) but nothing helped. What am I missing or doing wrong?


#2

Does this work? :
const { tomorrow : avgTemperatures.tomorrow } = tempOfTomorrow


#3

I get a syntax error:

SyntaxError: unknown: Unexpected token, expected , (10:36)
8 | // change code below this line
9 | // const {tomorrow : tempOfTomorrow} = AVG_TEMPERATURES;

10 | const { tomorrow : avgTemperatures.tomorrow } = tempOfTomorrow // change this line
| ^
11 | // change code above this line
12 | return tempOfTomorrow;
13 | }

Does it work for you?


#4

I hadn’t tried it. Let me get back to you


#5

This should work:
const { tomorrow : tempOfTomorrow } = avgTemperatures;


#6

Thank you! I don’t understand why that works but I am happy I can move on with my life. I was about ready to punch my machine in its interface.


#7

because you have “use strict” every line has to end with a ;


#8

Hi. I tired it with and without the semicolon; I tried it several different ways with the same result.


#9

Ah maybe because you passed it in lowercase and tried to reference it uppercase.