H I O X INDIA
Javascript Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 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
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.

others

privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Other Links