Basic Setup for JavaScript

To create scripts for JavaScript, you can simply use an editor like Notepad or Notepad++. These scripts can be launched directly in a browser like Chrome.

One can also use advanced editors like VSCode(Visual Studio Code), Atom, Sublime text etc. These editors provide a better environment and experience with the help of syntax highlighting, debugging and many other extensions.

Where does JavaScript run?

JavaScript can be executed either on the browsers or Node.js.

  • Browser
    Browsers are the platform for JavaScript codes to run. All the modern browsers support the JavaScript and own a built-in JavaScript Engine where the scripts are executed. For example,
Browser JavaScript Engine
Chrome v8
Firefox SpiderMonkey
  • Node.JS
    Node.JS is a platform independent runtime environment based on Chrome v8. It was developed by Ryan Dahl in 2009. He embedded Chrome's JavaScript Engine i.e v8 into a C++ code and the resultant was named as Node.js. This enabled to run the Scripts outside a browser i.e on Node and create the backend of web & mobile applications.

How to enable JavaScript in the Browser?

There is a possibility that JavaScript is disabled in a browser due to some reasons. You can manually enable it by following the given instructions.

Step 1: Go to Settings & jump to Advanced settings present at the bottom.
Step 2: Under Privacy & security, find the Content Settings and open it.
Step 3: Select JavaScript from the list of content settings.
Step 4: Turn on the toggle switch to enable the JavaScript.

Internet Explorer:
Step 1: Go to Tools and choose Internet Options.
Step 2: Open the Security tab and click on Custom level.
Here you will find multiple options for Security settings with enable/disable radio buttons.
Step 3: Find Active Scripting Option and click on the radio button to enable the JavaScript.

Step 1: Enter about:config in the address bar.
Step 2: You will be given a warning, click on 'I accept this risk'.
This will provide you with the list of configuration options with a search bar at the top.
Step 3: Enter javascript.enabled in the search bar.
If the value is true, it means that JavaScript is already enabled.
Step 4: If the value is false, right click on the screen and select Toggle.
This will enable the JavaScript & the value will change to true.

In this tutorial, we are going to use the Text editor VSCode.
You can easily download it for Windows or macOS or Linux through the website