WARNING

Are you sure you want to reset the challenge? You'll lose all changes you've made to the code.

Adding Properties

So far, we've added properties to objects when we created them. You can also add properties to an object after it's been created using either dot notation or bracket notation. Run the code in the editor to see an example.

Note: Notice that when you print the object, the key 'New York' has quotation marks. If a key has spaces or certain special characters, you must use quotation marks when using it and you thus cannot use dot notation.

Tests

Add two more properties to teamsByCity:

  1. key: Chicago, value: ["Cubs", "White Sox"]
  2. key: "Kansas City", value: "Royals"