H I O X INDIA
Javascript Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java-Script Tutorial
Introduction
Variables
Operators
Statements
Loops
Functions
Objects
Arrays
Browser Objects
Form DOM
Ask Your Doubts
More about Javascript
Feedback



Variable types in Javascript


Topic

What is a variable?
What are the variable types supported by javascript?



Explanation

Variables are used to store values.

i.e. for example if we have to add two numbers, we will declare two variables and assign the numbers to each variable and add them to get the result.
var a = 5;
var b= 5;
var c = a+b;

Javascript can handle the following variable types
a) Number (Integer and Float)
b) String
c) Boolean
d) Null
e) Undefined

In javascript all variable types are declared as var, only depending on how we assign the values the data type is defined.
var a = "as"; --> This is a string type variable
var a = 2; --> This is a integer type variable
var a = true; --> This is a boolean type variable
Here var defines it as a variable.
"a" is the variable name.
"as", 2, true are called values.

The variable name can have alphanumeric values. Any lowercase (a-z) or uppercase (A-Z) alphabets, numbers (0-9) or underscore(_).





        Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

privacy policy     license     sitemap
© 2004-2010 HIOX INDIA

Other Links