Tell us what’s happening:
Describe your issue in detail here.
Please help, it says
SyntaxError: unknown: Unexpected keyword ‘var’. (4:0)
**Your code so far**
const myDog = {
// Only change code below this line
name: "Rowdy"
legs: 4,
tails: 1,
friends: ["food"]
// Only change code above this line
};
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Challenge: Build JavaScript Objects
Link to the challenge:
udaaff
June 28, 2022, 8:25am
2
SyntaxError: unknown: Unexpected token, expected "," (6:0)
4 |
5 | name: "Rowdy"
> 6 | legs: 4,
| ^
7 | tails: 1,
8 | friends: ["food"]
9 |
i have tried everything, what line please
can you explain that please
@udaaff Showed you what line. There is an error on line 6 because of the missing comma on line 5. All of the key/value pairs in an object must be separated by a comma.
const myDog = {
// Only change code below this line
var myDog = {
“name”: “Rowdy”,
“legs”: 5,
“tails”: 1,
“friends”: [“food”],
};
// Only change code above this line
};
udaaff
June 28, 2022, 10:51am
8
You should not create the same var second time
thats my code, do i need a second comma on the line?
udaaff
June 28, 2022, 10:51am
10
We were discussing the code you posted in the first message.
i have changed var to myCat, same error.
udaaff
June 28, 2022, 10:55am
12
The object is already created for you, no need to define another one. You have to only change it contents.
system
Closed
December 27, 2022, 10:56pm
13
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.