---
title: "JavaScript Introduction"  
description: "JavaScriptis an easy-to-use programming language of HTML and the web.  This language increases the dynamic and interactive features of web page by all"  
author: "Jonas Stuart"  
published: 2016-07-02  
updated: 2018-03-16  
canonical: https://www.mindstick.com/blog/11171/javascript-introduction  
category: "javascript"  
tags: ["javascript", "java"]  
reading_time: 3 minutes  

---

# JavaScript Introduction

**JavaScript**is an easy-to-use [programming language](https://www.mindstick.com/articles/329035/5-most-in-demand-programming-languages-to-consider-for-your-app-development-in-2022) of HTML and the web. This language increases the dynamic and interactive features of [web page](https://www.mindstick.com/forum/718/sql-server-report-alignment-to-center-of-web-page) by allowing you to check forms, [perform calculation](https://answers.mindstick.com/qa/43847/how-to-perform-calculation-on-cmd), add special effects, create security passwords, writes interactive games, customized graphics selection and many more.\

JavaScript is an interpreted light weight programming language. This programming language is used to create network-centric application. [Implementation](https://www.mindstick.com/forum/33764/how-to-implementation-of-class-in-c-sharp) of JavaScript is very easy as it is integrated with HTML. It is [open source](https://www.mindstick.com/articles/337437/how-to-leverage-open-source-for-innovative-project-development) and cross platform.

##### Following is the syntax of JavaScript:

```
<html><body><p>Example of JavaScript.</p>
<p>The variables a,b , and c  are assigned the values 50, 60, and 110:</p><p id="example"></p>
<script>var a = 50;   // var is a keyword which is used to define a varialevar b = 60;var c = a+ b;
document.getElementById("example").innerHTML = c; // c is the result of a and b which gives 110.
</script>
</body></html>
```

**Note:**JavaScript statements are separated by semicolon. JavaScript statements are composed of operators, value, expression, comments and keywords.

**JavaScript values**

The javascript has [two variables](https://www.mindstick.com/forum/236/how-can-i-swap-two-variables-without-using-a-third-variable): Fixed value and [variable values](https://www.mindstick.com/forum/157371/swap-two-integers-variable-values-without-using-the-third-variable).

Fixed values are also [known as](https://answers.mindstick.com/qa/35703/ricky-ponting-is-also-known-as-what) literals.

**JavaScript Literals**

The necessary rules for writing fixed values are:

**Numbers** can be written with or without decimals.for example:

// literals can be with floating point or without. 12 12.32\

Strings are text, written within single quotes or double quotes:

\

“Rachel”‘Rachel’

**JavaScript Variables**

In any programming language, **variables** are used to **store** record.

JavaScript programming language uses the var keyword

to declare variables.

An equal sign is used to assign data to variables.

In this below example, a is a variable. Then, a is assigned the value 6:

var a ;a=6;\

**JavaScript Operators**

JavaScript programming language uses an **assignment operator ( = )**

to assign record to variables:

```
<p id="example"></p>
<script>
var a = 5;
var b = 6;
document.getElementById("example ").innerHTML = a + b;
</script>
```

JavaScript programming language uses [arithmetic operators](https://www.mindstick.com/forum/157625/what-is-meant-by-arithmetic-operators-in-python) ( + - * / )

to calculate values:

\

```
<p id="example"></p>
<script>
document.getElementById("example").innerHTML = (5 + 6) * 10;
</script>
```

**JavaScript Expressions**

An expression is a combination of variables, values, and operators, which

calculate the records.

The process called an **evaluation**. Following is an example:

```
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 50 * 110;
</script>
```

##### JavaScript Keywords

JavaScript **keywords** identify actions to be performed.

The var keyword is used to create a new variable:

```
<p id="example"></p>
<script>
var a = 50 + 60;
var b = a * 110;
document.getElementById("example").innerHTML = b;
</script>
```

##### JavaScript Comments

Code written after double slashes // or code between /* and */ is treated as

a comment.

These comments are ignored, and will not be executed:

**JavaScript is Case Sensitive**

All JavaScript are **case sensitive** which means variables var Name and var

name, are two different variables.

**JavaScript DataTypes**

Data types one of the most important characteristics of a programming

language. These are the type of data which is used to represent and

manipulate in a programming language.

There are three types of data types in JavaScrip −

- Numbers, eg. 2123, 1220.250 etc.
- Strings of text e.g. "This is my first JavaScript program" etc.
- Boolean e.g. [true or false](https://www.mindstick.com/forum/160329/how-can-you-convert-a-value-to-a-boolean-true-or-false-in-javascript).

Two trivial data types, null and **undefined** are also defined in JavaScript

which defines only single value. JavaScript also supports a composite data

type known as object. We will discuss objects in detail in next article.

---

Original Source: https://www.mindstick.com/blog/11171/javascript-introduction

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
