Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
210,850 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.