Tell us what’s happening:
Getting error like: destructuring with reassignment was used
Your code so far
const AVG_TEMPERATURES = {
today: 77.5,
tomorrow: 79
};
function getTempOfTmrw(avgTemperatures) {
“use strict”;
/*
though, i was trying to destruct, not get succeed!
const {x, y} = avgTemperatures;
return (Math.ceil((x+y)/2)); // getting error undefined x;
*/
return Math.ceil((avgTemperatures.today +avgTemperatures.tomorrow)/2);
}
console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
**Your browser information:**
User Agent is: <code>Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:63.0) Gecko/20100101 Firefox/63.0</code>.
**Link to the challenge:**
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects/