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 React Basics First Steps in React Create a React Element

emi sastra
emi sastra
37 Points

Can not find/open browser console at VS Code

After I wrote code at app.js as shown in video. But I do not know how to use browser console.

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 90,705 Points

Hi Emi,

To open the console in the browser (assuming you're following along in Google Chrome) use Ctrl + J shortcut. That'll give you access to the console tab. Later all when you download the extension you'll get the React tab as well which will allow you to analyse props and state.

If you're using the Terminal/Console in VS Code, you can open it using the Terminal menu, ---> New Terminal.

emi sastra
emi sastra
37 Points

Hi Jonathan,

Thank you for reply.

At new terminal, I just see powershell and bash. What should I do ?

Thank you.

Ezra Siton
Ezra Siton
12,644 Points

Open the browser console "how to"

  1. Video screen ==> "Launch workspace"
  2. Go to app.js file write this code and save:
const title = React.createElement(
  'h1',
  { id: 'main-title', title: 'This is a title.'},
  'hello my first react'
);

console.log(title);

Preview workspace

  1. workspace-Top right-corner click on the eye-icon (Preview workspace)
  2. Browser (chrome in my case) - right-click --> inspect (Or: ctrl + shift + i)
  3. Go to the console tab (The output):
Object

https://teamtreehouse.com/library/using-treehouse-workspaces