Destructuring Assignment to Assign Variables from Object

Tell us what’s happening:

I tried to solve but test case did not pass. can you please provide the solutuon.

Your code so far


const AVG_TEMPERATURES = {
  today: 77.5,
  tomorrow: 79
};


function getTempOfTmrw(avgTemperatures) {
  "use strict";
  // change code below this line
  const { tomorrow:tempOfTomorrow } = AVG_TEMPERATURES; // 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_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects

Hey @gaurav5295,
See if this helps:
Hers is:
Answer i gave to someone with similar question.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums