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 Understanding "this" in JavaScript

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,735 Points

Workspace for this workshop...

Sorry to be picky, but is there a reason that the workspace for this video is a snapshot linked in the teacher's notes rather than the usual button situation?

Also, isn't the workspace supposed to start out with what we see at the beginning? We're seeing stuff in the completed state with the code from the end of the workshop.

Huston Hedinger

4 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Brendan,

A Workshop is not like a course and doesn't usually have an active Workspace associated with it. I haven't watched this particular workshop yet, but if there is a link to a snapshot, it would be to give you the completed code so you could go through it and see how everything was created/accomplished. This would be the normal way of sharing code for workshops. Workshops, in my opinion, are designed to be short and only give one the basics, and then to let one research the finer and more specific details on one's own.

:dizzy:

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,735 Points

When I pointed out a lack of workspace on a different workshop (https://teamtreehouse.com/library/how-to-make-a-promise), they added a button not a snapshot link, and the workspace was the starting code not the completed code.

If there is an official policy to treat workshops differently when it comes to workspaces, it doesn't seem logical. The way it is now, if we want to follow along with what the teacher is doing, it takes more work to fork the snapshot and restore the code to the state it's in at the beginning of the video, which goes against the idea that workshops should be short and sweet. If someone wants to use the workshop to just listen and not follow along in a workspace, that's their choice, but there's no reason to make it more difficult to follow along.

I agree with Brendan. A workspace would have been very helpful for this video and I see no reason not to include one.

Also - just a general comment which applies to other courses as well - while it's helpful to include the completed code in a separate folder in the workspace (I've seen that in some of Dave McFarland's courses, which tend to be super well-done overall, BTW), I think it is an oversight not to provide a "blank slate" as the primary resource in a workspace. By that, I mean the code should be exactly at the point that the instructor starts with it in the beginning of the video, before he writes the first line of code in the video. I imagine many of us want to follow along with the instructor step-by-step, and requiring us to delete from the finished code to get back to that state is 1) kind of annoying and 2) can be confusing.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>title</title>
  </head>
  <body>
  <script type="text/javascript" src="main.js"></script>
  </body>
</html>
function helloWorld() {
  console.log("Hello world!");
  console.log(this);
};

helloWorld();

The first 2 files you need to get started.