Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Loops, Arrays and Objects Tracking Data Using Objects Create an Empty JavaScript Object

yousif alyousif
yousif alyousif
2,322 Points

need help with object !!

i am new by and my question might be stupid but how can i solve the error in this code:

var paris = { name : "", }; the code is in javascript :) and the question in the test is: Create an object named paris. To start, just create a new, empty object literal and assign it to the variable paris.

script.js
var paris = {
name : "",
};
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

try removing the comma after name : ""

1 Answer

yousif alyousif
yousif alyousif
2,322 Points

Solved it is not the comma it is name: "" that has to be removed thanks for your time