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

Issue with formatting within the workspace

Im having an issue in the workspace regarding formatting while writing functions. The parts of code on my workspace are also highlighted differently than on the instructors screen as well. For example when I use an arrow operator(=>) in a function, it is black on the instructors screen and red on mine.

The issue with formatting comes when I'm writing a function and add the curly braces and hit enter, the next line is indented to the parenthesis where the function begins. Ive isolated this to a different test workspace and had the same issue. Im not sure if its an error on my end or just the workspace being updated to perform differently since the time of the video being published. Ive contacted support and they had no help or information at all and directed me to here. Please excuse my ignorance and lack the right potential terminology

Im stumped here and this has been a major roadblock for me, especially in attempting to mirror what the instructor is doing. Im having a hard time articulating the issue I'm having due to my ignorance and lack of understanding of JavaScript in general. Im attaching a link to a screencap where you can see the issue I'm having in action. Thanks in advance for any help with this issue, I'm really hoping for clarification so I can continue on

https://imgur.com/YbSQ1KE

1 Answer

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

Hey Jason Sachs, thanks for reaching out. If you click shift and enter, that closing curly brace will stick all the way over to the left side of the window when dropping to the next line. It's not always a perfect solution, but that little trick can be helpful.

Also, keep in mind that Workspaces is really more of a lightweight introductory text editor meant for small jobs and new students who haven't had experience with other text editor programs that would be installed on their own machine. It's a handy tool, and a cool Treehouse feature, but workspaces should not be considered a permanent or long term text editor solution. Once you start feel more comfortable using a text editor, it is recommended that you explore the text editor options out there and find one that works well for you. There are many free options, but my favorite, and the one that's kind of taking the world by storm right now is definitely the open source editor from Microsoft, Visual Studio Code. Here's a fantastic Treehouse workshop that introduces that awesome text editor. Hope that helps. :thumbsup:

Thank you so much for the suggestion! Do you have any insight on the difference of what’s highlighted on my workspace compared to the instructors?

Robert Manolis
Robert Manolis
Treehouse Guest Teacher

No, not really, Jason Sachs, sorry. I imagine it likely has to do with versions of workspaces. Perhaps the rules and features of workspaces were slightly different when the course was made. I wouldn't worry about it too much as long as your code runs. :thumbsup: