Javascript Environment Setup

As we already know, Javascript is an interpreted language. So before running a block of Javascript code, we have to translate the code using a Javascript Interpreter.

But in client-side Javascript, we do not need any code compilation or interpretation for running Javascript code within a modern browser. Because every modern browser comes with dedicated Javascript engine by default.

So you can immediately run a block of Javascript code within a web browser without any additional environment setup.

You may also test Javascript code along with HTML and CSS code.

Editing Javascript

In this tutorial we will learn javascript from very basic to advanced with lots of example code. Example is the best way to figure out a programming language you know.

So, to test an example provided by PrograCoding or your own code you have two options.

  • Using online interpreter console.
  • Using local text editor and web browsers

Now, which option you will use, it depends on up to you.

Using Online Console

You can use an online console to write, test and run your code. In this case, you must have a internet connection. Tools like JSConsole can be used to write and test code.

Using Local Code Editor

In this case, you can use any simple or advanced text editor (e,g: notepad or notepad++) to write and edit your javascript code. But using an advanced text editor like notepad++ can help you to read the syntax easily by enabling syntax highlighting features.

Then you can run the source code locally via a modern web browser by embedding the javascript file within a simple HTML page with <script> tag. We will learn more about JS code implementation in the later chapters.

You don’t need any additional interpreter or compiler to run JS code locally. Because web browsers are built-in Javascript. It will compile the javascript code immediately when you run code using the Just-in-time (JIT) compilation rule.

You can see the output of a block of Javascript code in the browser window. And you can debug the code using browser debugger console tool. To enable debugger mode press Ctrl+F12 from keyboard.

We will learn in detail about Javascript error and debugging in the later chapters.

« Previous Next »

Posted in