Where to write JavaScript and run JavaScript programs?

Where to write JavaScript and run JavaScript programs?

Well, this would be a very basic question that would come to someone’s mind, that it is ok that I am going to learn JavaScript now, but where am I going to write the JavaScript programs? And where am I going to see the outputs?

Well, for writing programs, we would need some text editor/code editor, and you are free to use any text editor/code editor, that you are already familiar with.

Also, talking about where we are going to see the output, most probably, you have that thing in your computers, or laptops already, and that thing is called a browser(at least in our case).

Where to write JavaScript & run JavaScript programs?

So, there are basically two concerns –

  • Where to write JavaScript programs?
  • Where am I going to see the outputs?

Let’s first briefly answer concern number 1 –

As stated earlier, for writing JavaScript programs, you just have to use some text editor or code editor, and you can use any text editor or code editor, that you are already familiar with. But here, to make the process even more simple, we are going to make use of something called an IDE, or integrated development environment, and the IDE that we are going to use here is Visual Studio Code, which is an open-source and free to use IDE, developed by Microsoft. If you want to, you can also download and install the VS code in your systems.

There are many other IDEs or text editors/code editors available, like Visual Studio Code, Atom, sublime text editor, etc and you can use any IDE or text editor, that you are comfortable with. If you wish to follow us throughout the course, you can try using Visual Studio Code.

There are many advantages of using an Integrated Development Environment –

  • The code is colored so that we can understand it better.
  • There are some extensions like Live server, which we are going to use.
  • Code auto-completion.
  • Errors in the code are easy to be determined.

And a few other advantages… but these are enough… if you have not installed the IDE, you can download it from here → https://code.visualstudio.com/download

Ok, so the first concern seems to be clear as of now. Now, let’s get to the next concern, which is, where can we see the output?

So, as stated earlier again, you most probably already have that thing, where we are going to see the outputs, and that thing is called a browser (at least in our case). So, basically, we are going to see the outputs on the browser.

There would be some setup(like writing a separate JavaScript file, and giving its path in the HTML file), and then we have to open the HTML file in the browser, and then we have to go to the developer tools(you can just press F12 key, or right-click on the website, and click inspect), where we can find the console. We are going to spend most of the time looking for outputs here on the console.

So, now you have the answers to both the concerns. Now, let’s get started.