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

Emeka Okoro
PLUS
Emeka Okoro
Courses Plus Student 11,724 Points

JavaScript Shell

Hi everyone. Is there a JavaScript shell like that of python that I can use for practice and where can I download it for windows?

5 Answers

JavaScript is run in a browser. Create an HTML file and add your JavaScript there. As long as you save it as "index.html", you can open it using Chrome, IE, Safari, etc.. and it will run your JavaScript.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
 </head>
<body>
  <script>

//add your code here

  </script>
</body>
</html>

Let me further elaborate.

  • Copy the text I provided into a notepad and then save as "index.html".
  • You can then add Javascript where I left the comment "add your code here"--between the <script></script> tags.

Unlike python, JavaScript is run through a browser and does not need anything else. Think of the browser as your shell.

Jesus Mendoza
Jesus Mendoza
23,289 Points

You can use Node.js

And run your code using

node /path/to/file.js