Learn Basic JavaScript by Building a Role Playing Game - Step 50


Step 50

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.

const = {
// Throws an error
“Number of legs 4”: cat,


console.logs(cat “4”);

SyntaxError: unknown: Unexpected token (21:0)

Pls help? with

Hi there. Welcome to your first topic on the forums. In the future, please use the “Ask for Help” button. It will appear after you try to submit your code three times. This button will automatically create a topic for you in the JavaScript section, and provide a link to the challenge. In addition, it will also set the name of your thread to something less generic as freeCodeCamp.org, which is the name of the site.

I have renamed and moved your thread to the right place.

Regarding your code, personally I would possibly recommend reviewing the earlier steps in this section before proceeding.

As a general summary for what you need to review:

  • How to declare an object
  • How to create a property inside of an object
  • How to log something to the browser console.

In the meantime, I would hit the reset button for this challenge and look over this example:

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


In this example, there is an object named spaceObj that has a property of Space Name. The property Space Name has been assigned a value of Kirk. In the browser console, this object would show up as

{'Space Name' : 'Kirk'} 

Hope this helps you get started.