Learn Basic Javascript by Building a role playing Game

If the property name (key) of an object has a space in it, you will need to use single or double quotes around the name.

Here is an example of an object with a property name that has a space:

const spaceObj = {
  "Space Name": "Kirk",

If you tried to write a key without the quotes, it would throw an error:

const spaceObj = {
  // Throws an error
  Space Name: "Kirk",

Add a new property with a key of "Number of legs" and value of 4 to the cat object.

Open up the console to see the output.

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help