I'm new to coding

I'm new to coding
0

#1

I’m new to coding and have no idea how to do any of this, so I’m confused how is this wrong.
does anyone know how I could fix it.

let dog = {
  name: "Spot",
  numLegs: 4,
  sayLegs: function() {return "This dog has " + dog.numLegs + "legs.";}
};
dog.sayLegs();

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/create-a-method-on-an-object/


#2

Welcome!

The best things to add in your post would be what you see happening and what you expect to happen, in writing those down it helps us know what’s going on and you may even figure it out yourself as you do

In this case I would do console.log(dog.sayLegs()); and see if the answer is what I expected

It’s not in this case, you’re missing a space!

Best of luck with the challenges


#3

I’ll try it, Thanks!