JavaScript Part 1: Setup and Introduction

JavaScript Part 1: Setup and Introduction


Please Subscribe Youtube| Like Facebook | Follow Twitter

Introduction

Welcome to JavaScript beginner tutorial series. In this article you will learn how to setup JavaScript on your machine. JavaScript is a high-level, interpreted programming language that is used to create interactive and dynamic web pages. It was initially developed by Brendan Eich at Netscape in 1995 and has since become one of the most widely used languages for web development. JavaScript can be used both on the client-side (in web browsers) and on the server-side (with the help of Node.js), making it a versatile language for building full-stack web applications. Some of the key features of JavaScript include its dynamic typing, first-class functions, and prototype-based object-oriented programming model. With its ease of use and broad range of applications, JavaScript has become an essential skill for developers working in the web development space.

In this article, we will guide you on how to set up Visual Studio Code for JavaScript coding on both Windows and Linux platforms. We will also show you how to write a simple “Hello World” program in JavaScript using Visual Studio Code.

Setup

Setting up Visual Studio Code on Windows

To set up Visual Studio Code on Windows for JavaScript coding, follow these simple steps:

  1. Download the Visual Studio Code installer from the official website.
  2. Run the installer and follow the instructions to install Visual Studio Code on your system.
  3. Launch Visual Studio Code and install the “JavaScript” extension from the extensions marketplace by clicking on the extensions icon on the left-hand side of the editor and searching for “JavaScript”.

Setting up Visual Studio Code on Linux

To set up Visual Studio Code on Linux for JavaScript coding, follow these steps:

  1. Download the Visual Studio Code package for your Linux distribution from the official website.
  2. Install the package by following the instructions for your distribution. For example, if you are using Ubuntu, you can install the package using the following command:
sudo dpkg -i <package-name>.deb
  1. Launch Visual Studio Code and install the “JavaScript” extension from the extensions marketplace by clicking on the extensions icon on the left-hand side of the editor and searching for “JavaScript”.

Writing a “Hello World” program in JavaScript using Visual Studio Code

To write a simple “Hello World” program in JavaScript using Visual Studio Code, follow these steps:

  1. Launch Visual Studio Code and create a new file by clicking on “File” and selecting “New File”.
  2. Type the following code in the editor:
console.log("Hello World!");
  1. Save the file with a “.js” extension by clicking on “File” and selecting “Save As”. Choose a file name and save the file with the “.js” extension.
  2. Open a terminal or command prompt and navigate to the directory where you saved the file.
  3. Type the following command to run the program:
node <filename>.js

For example, if you saved the file as “hello.js”, you would run the program using the following command:

node hello.js

After running command “Hello World!” will be printed

JavaScript Beginner Tutorial Series

Please Subscribe Youtube| Like Facebook | Follow Twitter


Leave a Reply

Your email address will not be published. Required fields are marked *