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 trial

JavaScript

nazareth kohl
nazareth kohl
1,223 Points

oojs.html file: Why won't it work?

So, I have the oojs.html file with the empty script tag, and I put const person = {}; in it, saved the file, brought Visual Studios back up, entered person into my Javascript tab, and then pressed enter, but nothing came up. Did I do everything right? What's wrong?

nazareth kohl
nazareth kohl
1,223 Points

This is for the 'Introduction to Javascript' Course, by the way.

1 Answer

Laura Coronel
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Laura Coronel
Treehouse Teacher

Hi nazareth kohl ,

Thanks for reaching out! I’m happy to help with both questions.

1. Using the JavaScript console

It sounds like you’re on the right track! The JavaScript console is a tool built into your browser that lets you run JavaScript commands and see their results. You’ll want to use the console in your browser (such as Chrome), rather than the JavaScript tab in Visual Studio Code.

Here’s how the exercise should work:

  1. In your oojs.html file, make sure you have const person = {}; between the opening <script> and closing </script> tags, as you’ve done.
  2. Save the file and open or refresh it in your browser.
  3. Open your browser’s Developer Tools and select the Console tab. In Chrome, you can usually do this by right-clicking the page, selecting Inspect, and then clicking Console.
  4. Type person into the console and press Enter.

You should see something representing an empty object, such as Object {} or {}. That's expected! The exercise is simply showing you how to create an object and inspect it in the console. You haven't done anything wrong.

2. Accessing Chapter 2

If the Resume Course button isn't working, you can access Chapter 2 directly using this link:

https://teamtreehouse.com/library/upi-chapter-2-integration-of-javascript-with-html

Once you open the page, scroll down to see the list of steps in the chapter. You should be able to click on any step to access it.

I hope this helps!