Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active May 6, 2022 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/31110d6504d213cd911ef0f2e200a3ff to your computer and use it in GitHub Desktop.
Save McLarenCollege/31110d6504d213cd911ef0f2e200a3ff to your computer and use it in GitHub Desktop.
Add your city to Weather Object
let weather = {
  London: {
    temp: 37,
    humidity: 44,
  },
  Mumbai: {
    temp: 32,
    humidity: 80,
  },
};

Task 1

Create a variable myCity and assign to it the name of your current city.

Task 2:

Add a property to the weather object with your city and current weather numbers of your city in same format. Use the myCity variable while adding property.

Task 3:

Compare your city temperature to London and Mumbai and print the following output

// " My city is having less/more/equal temperature than London"

// " My city is having less/more/equal temperature than Mumbai"

Task 4:

Compare your city humidity to London and Mumbai and print

// " My city is having less/more/equal humidity than London"

// " My city is having less/more/equal humidity than Mumbai"

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