Bummer! You must be logged in to access this page.

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 Working with Strings Transform and Manipulate Strings

using alert and console.log gives me a referenceError

If I try to run both alert() and console.log() on a text editor it will give me referenceError, but if I remove one the error goes away. is this supposed to happen? if not, how do I fix it.

I'm not seeing a problem in my browser when using both alert() and console.log().

Can you show the code that you are using? A ReferenceError indicates that you are referencing a variable that is non-existent.

that's the thing, Its a problem on a text editor such as VScode not the browser. I never said I had a problem in a browser I said the problem was in a text editor.

1 Answer

Steven Parker
Steven Parker
231,275 Points

You should show your actual code to make it possible to investigate the issue.

Also, a text editor doesn't typically have any way to run code, and often will depend on configuring external resources to perform this function. So check your configuration, it could be as likely to cause an issue as the code itself.