I need a place i can test my functions in

is there any place on the internet I can test my javascript functions and see the output or the result of when I call those functions?
or should they be in an HTML code ?
thank you

There’re a few sites out there, I like to use Code Sandbox.

You could also load up your developer tools on any web page and run things in the console.

If the functions you want to test don’t need to be run in a browser then you can use nodejs to run your JS at the command line.

where is the console of a web page?
how to load my developer tools on a webpage and what are developer tools?

maybe it is an early question since I did not finish the javascript course yet.

While using your browser press the F12 key to pop open the dev tools. You should see a Console tab at the top that will allow you to execute JS. It’s great for doing short little snippets of JS but if you have functions you want to test with input then I would recommend nodejs instead.

You should definitely get familiar with the dev tools as they are the developer’s best friend.

For Chrome: Open a new tab, right click anywhere and click on “Inspect” in the menu. Then you will get something like this in a portion of the webpage.


Elements tab -displays HTML for that webpage.
For now, we need the Console tab… click on it… ignore whatever errors already there (they would we because of the new tab)… just copy-paste your code in the console and press enter.

In case you are using Safari, go to → Preferences → Advanced → CLick on “Show Develop menu in Menu bar” .
Then go to Develop in the menu bar and click on “Show Javascript Console” or you can again right-click → Inspect like in Chrome…

2 Likes

i dont know how to use nodejs

There are a ton of tutorials out there. I’m sure you can find one that works for you.

1 Like

anything with a console will show you that if you use console.log to print the function result, including while you are working on fcc challenges

1 Like

I’ve been using RunJS for almost 3 years now, which is perfect for testing functions out, writing utils for bigger code bases and just playing around with JavaScript in general. It runs on desktop so it’s a nice companion app in my work & home environment. Definitely give it a try!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.