Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatilde Errico
7,076 PointsTask 1 is no longer passing. GOT STUCK!!!!!
I really don't know where the problem is.There are quotes around the string,commas,parenthesis.What is missing?
var objects = [
{
name: "Carla",
age:45
} ,
{
name:"Matilde",
age:35
} ,
{
name:"Pino",
age=46
}
];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
andren
28,558 PointsYour code is nearly correct, you just have a typo. In your last object you use the = symbol to separate the age
property and the value instead of a colon.
If you fix that like this:
var objects = [
{
name: "Carla",
age: 45
},
{
name: "Matilde",
age: 35
},
{
name: "Pino",
age: 46 // = replaced with :
}
];
Then your code will work.
Matilde Errico
7,076 PointsThanks Andren,spent around 15 minutes and I didn’t noticed that equal sign ? Thanks