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 Debug Functions

Gal Parselany
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gal Parselany
Full Stack JavaScript Techdegree Graduate 26,281 Points

how do you see that the view is the reverse?

In 1:50, something like that :

How the teacher is seeing the that view par is = to the reverse obj? I dont get it please help with this, thanks in advance.

Same as the options, how did the teacher get that the option is the original obj?

I understand how to fix it from the app.js but I dont get it, how he got this from the response.js?

3 Answers

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

My apologies!

It looks as though he's utilizing the step into button here when he's currently paused on line 41 for response.render.

The render method is created by Express and you can see it opens up the file response.js which comes with Express.

Since we called response.render('reverse', {reversed});, we're passing in 'reverse' as our view we want to render.

So back in response.js it's parameter, which is named view by Express, now currently holds the string 'reverse' as it's value. He sees a brief tip pop up when hovering over the parameter that shows it's value, and while in the Debug Console, he's able to type in the variables he wants to see the values for.

While he's there, he realizes that only the reversed object key/value was there, knowing that there should have been an original key/value pair as well, therefore he adds it.

I hope this breaks it down a bit better and I hope I understood your question correctly this time :smile:

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

Hey there Gal Parselany !

If you head back to the 2nd video in this Workshop, you'll see that you get that view by clicking the bug icon on the left side of the screen within VS Code. It looks slightly different now as it's a smaller bug in front of a right-faced (play button) triangle.

Then, inside of the video this was posted on, he's using the Debug Console at the bottom of the screen. If you open up a terminal (CMD+`) or (CTRL+`) you'll see it as a tab option next to Terminal.

Gal Parselany
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gal Parselany
Full Stack JavaScript Techdegree Graduate 26,281 Points

I mean when the teacher say "view", when he says that the option parameter in the function is equal to the view in the response.js? not the debug view, but thanks for this explnation aswell.