Getting super hacked off trying to test JavaScript

Can someone tell me something I can type JavaScript into which will actually run it and allows me to debug my code. freeCodeCamp is useless for anything more advanced than “Hello World!” (I’m onto to the algorithms and Check for Palindromes, I need to see what it is doing to my strings and why it’s not working)

I’ve tried Visual Studio Code and after wading through some gibberish, a link taking me back to what I’d already installed and instructions in the wrong order, I get “the term node is not recognized” error. Funnily enough I’d like to actually install something and it, you know, work.

CodePen was useless and kept wanting a HTML or CSV file, even when it had one.

Why is this made such an ordeal? I can learn and write code, I just don’t want to be water boarded before I get started.

1 Like

Have you tried using console.log(your-data-here)? It’s the quickest way to throw some code for you to see and you can put it in any part of the script to print something like a variable. When you check the console in the browser’s Development Tools (usually toggled by Ctrl+Shift+I or F12).
Hope this helps. Just keep calm and you’ll get there, mate. :slight_smile:

1 Like

also type debugger; into you code then right click inspect element this will bring you to the developer tab … go to source … (you should have half page freecodecamp and half page developer tools) then click run test on freecodecamp page … source panel will then show your code with it paused where your debugger statement is … and you can now step through your code.
google developer tools if you have trouble on how to do this … might seem tricky starting off but its easy when you do it a lot

Yes the F12 thing is useful thanks. I got it working without debugging in the end, but the console.log stuff and so on was not showing up in the little black box.

To be perfectly honest (and I have the feeling a lot of other people agree with me) the FreeCodeCamp editor is barely usable. The code runs from this really hard-to-find spot, my efforts to set breakpoints are fruitless, and overall, it just isn’t a very good design. (Plus, it runs my function a bunch of times, so if I set any console.log statements, I get a bunch of messages). If you’d like a nice offline HTML and JS editor, I’d go with Brackets.

Try this, it works great: Repl.it

2 Likes

I second this, repl.it works great

You can do it directly on FCC, too, just open your Chrome Development Tool and use the console to debug