0

I'm reading books on JavaScript programming, and I need an environment like Python's IDLE to type JavaScript commands into and then see the results like you would in IDLE.

Is there an environment where you can do such a thing?

14

Any of the major browsers (IE, FireFox, Chrome, Safari, etc..) will execute and display the results of JavaScript code that you put into it.

You can open the developer console in Chrome and in IE using F12 and in Firefox using Ctrl+Shift+K. Alternatively you can simply put it into a .html file.

|improve this answer|||||
  • 4
    This answer really needs to say more about how to put the Javascript into your browser; in particular, it ought to mention the Javascript console. – user2357112 supports Monica Jul 18 '14 at 9:01
13

I find http://jsfiddle.net/ to be a good test environment for trying things out (in JavaScript, HTML and CSS), if you just want to try something easily and now using your browser.

|improve this answer|||||
  • 1
    I second jsfiddle, especially because it's really plug&play. You don't need to worry about connecting your HTML and CSS to your javascript properly, and it reacts almost instantly. You just write your code, write your HTML, press a button and you see the result instantly. And because it's a website, you can link other people to your code extremely easily for debugging and demonstration purposes. – Nzall Jul 18 '14 at 9:24
3

Mainstream browsers’ dev tools have a console for executing expressions:

See also Plunker. It is similar to the already mentioned jsFiddle.

|improve this answer|||||
  • @MattThrower See first comment of the first answer. That answer was edited since then. My answer points to exactly what is needed and there is not much point copy-pasting the information that is already perfectly worded. Please apply a bit of common sense next time instead of following the guidelines blindly. – Den Jul 18 '14 at 13:04
  • Reminders to use common sense are always appreciated. But in this case, I already did. Mileage varies. – Bob Tway Jul 18 '14 at 13:20
2

Most of the answers centre on JavaScript code in the web browser. If you're interested in server-side JavaScript code (or more generally, JavaScript code in non-browser environments), then you've got a couple of other options:

  • Node.js is currently the most popular server-side JavaScript framework and comes with an interactive console. Once you've installed Node.js, you can start the console either from the Start Menu, or by typing node into a terminal.
  • There's also a reasonable amount of buzz about Nashorn, which is bundled with Java 8. Once you've installed JDK 8, you can start the console by running jjs, which depending on your OS will either be available automatically from the terminal, or found at $JAVA_HOME/bin/jjs.
|improve this answer|||||
0

As for actual IDE's, you could use Visual Studio (express version is free). They've added better JS intellisense support in the past few releases.

|improve this answer|||||
0

Jetbrains Webstorm is an IDE you can use as well, if that's the sort of thing you're looking into.

Otherwise, there's probably an eclipse plugin.

There's also Sublime Text and Atom, that, with a few plugins, can do it very well.

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.