loader

Loading

CoderrShyam logo

CoderrShyam

HomeAboutContactBlogTutorials
LoginSignup

Introduction

Quick StartWhat is JavaScriptHistory of JavaScript

Setup

Node.js InstallationVisual Studio Code

Basics

Syntax & Comments
Variables
Functions

Advanced

CoderrShyam logo

CoderrShyam

HomeAboutContactBlogTutorials
LoginSignup
TutorialsJavaScript TutorialVisual Studio Code

Visual Studio Code

Set up Visual Studio Code to write and run your JavaScript code.

Introduction

Visual Studio Code (VS Code) is one of the most popular code editors among JavaScript developers. It's lightweight, fast, and packed with powerful features that make coding easier, including syntax highlighting, extensions, and an integrated terminal.

Why Visual Studio Code?

VS Code is free, open source, supports many languages, and has a rich ecosystem of extensions tailored for JavaScript development.

Installation Steps

Download Visual Studio Code

Visit the official Visual Studio Code website and click the Download button to get the installer for your operating system (Windows, macOS, or Linux).

Run the Installer

After downloading, open the installer and follow the on-screen instructions. It is generally recommended to keep the default options.

Launch Visual Studio Code

After installation, start Visual Studio Code from your start menu or applications folder.

Install Recommended Extensions

For JavaScript, these extensions will improve your workflow:

  • ESLint: Linting and code style checking
  • Prettier: Code formatting
  • Biome: Code linting and formatting, a newer and faster successor of eslint and prettier
  • JavaScript (ES6) code snippets: Faster writing of common code
  • Live Server: Instantly preview your HTML/JavaScript files in the browser with live reloading

You can find these by going to the Extensions sidebar (or press Ctrl+Shift+X) and searching for their names.

That's It!

VS Code is ready for your JavaScript projects!

First JavaScript Program

Let's write and run your very first JavaScript program in VS Code.

Create a New JavaScript File

Open VS Code and create a new file (File > New File or press Ctrl + N). Save it with a .js extension, for example: app.js.

Write Your JavaScript Code

In your new file, type a simple line of code, such as:

app.js
console.log("Hello, World!");

Then save the file with Ctrl + S.

Open the Command Palette

To run the file, open the Command Palette by pressing Ctrl + Shift + P or by going to View > Command Palette.

Run the JavaScript File

In the Command Palette, search for Run JavaScript and select Run JavaScript file in terminal. This will open the terminal and run your file.

View the Output

You'll see the output in the terminal window, for example:

Hello, World!

(Alternative) Run JavaScript with Node.js

You can also run your file directly in the terminal with Node.js. First, make sure Node.js is installed, then go to the folder containing your file and type:

Terminal
node app.js

This will execute your JavaScript code and show the output in the terminal.

Awesome!

That's it — you just ran your first JavaScript program in Visual Studio Code. Let's keep coding!

How is this guide?

March 7th, 2026

Node.js Installation

Install Node.js to run JavaScript on your computer.

Syntax & Comments

Learn how JavaScript statements and comments work to structure your code.

© 2026CoderrShyamAll Rights Reserved.

On this page

Introduction
Installation Steps
Download Visual Studio Code
Run the Installer
Launch Visual Studio Code
Install Recommended Extensions
That's It!
First JavaScript Program
Create a New JavaScript File
Write Your JavaScript Code
Open the Command Palette
Run the JavaScript File
View the Output
(Alternative) Run JavaScript with Node.js
Follow us on GitHub