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

Ana María Benites Rodríguez
Ana María Benites Rodríguez
1,011 Points

Why running this code in the node.js terminal and not in the browser console?

why in this exercise we need to run node.js from the terminal and we can not just test this code in the browser?Thanks!

Adam Beer
Adam Beer
11,314 Points

Node.js is running in the background, easiest to get from the terminal to reach. If you use native node or express and give a port you also have access to the browser. But the simplest way is to test it from the terminal.

1 Answer

Ana María Benites Rodríguez
Ana María Benites Rodríguez
1,011 Points

thanks @Adam Beer for the quick answer. Why when I write "normal" JS I can run it directly from the browser and why in this case I have to run it from the server (using node from the terminal)? thanks!

Adam Beer
Adam Beer
11,314 Points

Please mark where you are in node.js course.