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 JavaScript Basics (Retired) Storing and Tracking Information with Variables Working with Strings and Finding Help

Preview problem after saving workspace for video 7 I get the message can you fix the Java code?

Video 7 in working with strings and getting answers Here is my code var passphrase = 'Open Sesame'; console.log(passphrase);

This works on a java test site var passphrase = 'Open Sesame'; passphrase.length;

Steven Parker
Steven Parker
231,275 Points

It might help if you make a snapshot of your workspace and post the link to it here. Also please describe exactly what steps to take to see this error.

I relaunched workspace as requested for this particular video. To do this I closed all workspaces and relaunched workspaces from the button in the bottom right corner of the screen.

I added the following code:

var passphrase = 'Open Sesame'; console.log(passphrase.length);

I pressed save in the file menu I clicked on the preview Icon

It gives me text saying "Can you fix the Java code.

Snapshot: https://w.trhou.se/2yqt99mxbr

4 Answers

Steven Parker
Steven Parker
231,275 Points

It actually says "Can you get the JavaScript to work?", and that's because it is coded into index.html on line 10:

index.html
  <h1>Can you get the JavaScript to work?</h1>

But it is also running the script and logging the string length (11) to the console. So everything seems to be working as it should!

Gabriel Rumbaut
Gabriel Rumbaut
2,476 Points

Do you have the console open? This wouldn't print to the HTML--for that, you'd need to use document.write. Console.log prints to the developer console.

Thank you to everyone for their feedback!

Solved!