What's a good self-contained JS hub?

I've been using CodeAcademy, but I'm looking for something a bit more local to learn JS.


Basically I just want to write a couple of functions and test them. Like a function that calculates 2^x, a function that calls that function and adjusts it. Self-contained simple stuff like that. What would be a good program or website for it? CodeAcademy is great but each time you have to perform a specific task so for a "sandbox" purpose it's not very useful.


And editing an RMMV project just to try out functions like this is not ideal either.


Thanks. 🙂
For really simple things i just use the console inside the Chrome developer tools (F12). For more complex stuff, you could use JSFiddle (https://jsfiddle.net/) or similar.
Thanks. 🙂 Does JSFiddle not have a console? e.g. console.log(12) doesn't show me anything anywhere. (I'm just now getting oriented with it though, so I apologize if I'm missing something obvious.)
I always use this to test out bits of code to see if they work. It has a console, too.


https://repl.it/languages/javascript
It logs to the console, but doesn't display it on the page itself. You can still see it via F12, though. To be honest, i haven't used JSFiddle that much, since i usually just create a simple html page and run it inside the browser, using the developer tools for everything else.
I always use this to test out bits of code to see if they work. It has a console, too.


https://repl.it/languages/javascript

Perfect! Thanks!
Honestly the developer  tools in browsers (Chrome, IE, Firefox) are the best way to test out most things JS. If you want to test out AJAX or libraries (like jQuery) though, it doesn't always work. 


You can just create a plain old HTML page in a folder with your libraries and throw your test code in a <script></script> block but you can't test out AJAX requests in Chrome this way (it's a security thing) so you may want to test this out in JSFiddle OR run your game and then access the dev console via F8. The game window appears to run differently than just a regular browser window and XMLHttpRequests (AJAX) actually work. 


Also I highly recommend http://jshint.com for checking the validity of your code. It will really help you with best coding practices and debugging. 
Try http://js.do/, delete everything and start writing your code. I normally use that site for testing JS features.


For expression try https://regex101.com/ 

Original thread: https://forums.rpgmakerweb.com/threads/whats-a-good-self-contained-js-hub.63393/