Skip to content

Instantly share code, notes, and snippets.

@hannahhch
Created December 3, 2020 20:46
Show Gist options
  • Save hannahhch/2f33ea6fe2ab60d13695fea955e0426e to your computer and use it in GitHub Desktop.
Save hannahhch/2f33ea6fe2ab60d13695fea955e0426e to your computer and use it in GitHub Desktop.

Weather Warm Up

let today = 'wednesday';

let weather = {
   monday: 'sunny',
   tuesday: 'rainy',
   wednesday: 'sunny',
   thursday: 'snowy',
   friday: 'windy
};
		
  1. (without coding first), what do you think will happen if we try to console out weather[monday] ?

  2. The weather forecast has changed! Change the weather on friday from "windy" to "snowy".

  3. Change the variable today to today's day. Use this variable to console out the weather for today.

  4. Write a function to console out the weather for each day. // Eg: "On Monday, it will be sunny. On Tuesday, it will be Rainy... etc"

  5. Change the previous function to console out the weather for each day, but include today. //Eg: "Today it will be sunny. On Tuesday, it will be rainy, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment