an easy-to-use programming language
of HTML and the web. This language
increases the dynamic and interactive features of web page by allowing you to
check forms, perform calculation, add special effects, create security
passwords, writes interactive games, customized graphics selection and many
language. This programming language is used to create network-centric
HTML. It is open source and cross platform.
Following is the syntax
variables a,b , and c are assigned the
values 50, 60, and 110:</p>
= 50; // var is a keyword which is
used to define a variale
= a+ b;
= c; // c is the result of a and b which gives
composed of operators, value, expression, comments and keywords.
Fixed values are also known as literals.
The necessary rules for writing
fixed values are:
Numbers can be written with or without decimals.for
// literals can be with floating point or without.
Strings are text,
written within single quotes or double quotes:
In any programming language, variables are
used to store record.
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:
uses an assignment operator ( = ) to assign record to variables:
var a = 5;
var b = 6;
document.getElementById("example ").innerHTML = a + b;
language uses arithmetic operators ( + - * / ) to calculate values:
document.getElementById("example").innerHTML = (5 + 6)
An expression is a combination of
variables, values, and operators, which calculate the records.
The process called an evaluation. Following is an example:
document.getElementById("demo").innerHTML = 50 * 110;
identify actions to be performed.
The var keyword is used to create a new
var a = 50 + 60;
var b = a * 110;
document.getElementById("example").innerHTML = b;
Code written after double slashes // or code between /* and */ is treated as a comment.
These comments are ignored, and
will not be executed:
is Case Sensitive
sensitive which means variables var Name and var
name, are two different variables.
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
Boolean e.g. true or false.
Two trivial data types, null and undefined
known as object. We will
discuss objects in detail in next article.