![]() |
Types of Variables![]() ![]() ![]() ![]() ![]()
Variables are used to store values. Variable names can have uppercase letters(A-Z) ' lowercase letters(a-z),digits(0-9), underscore( - ).The first character should be an alphabet or an underscore. Variables cannot have blank spaces or other punctuation marks. Variables are case sensitive Variable names can be of any length. Variables are defined with the optional keyword var. Unlike other programming languages , JavaScript does not require you to specify the type of data contained in a variable. The same variable can hold different values such as string, integer, Boolean etc,.
Variables 1. Number 2. Boolean 3. String 4. Null 5. Undefined Number - It can be an integer number,floating point number or a special value called NaN(Not a Number). Boolean - It can have logical values true and false. String - It can have string values enclosed in single or double quotes. Null - It consists of a single value null which defines empty or non existent reference. Undefined : It has a single value undefined, which indicates that a variable has not been assigned a value. Number types Number is of two types namely: 1 . Integer 2. Floating Point
Integer literals can be represented in three different bases:
1 . A decimal integer which consists of digits from 0 through 9
Floating Point literals Floating point literals are used to represent numbers with decimal point or numbers. String values can be given within single or double quotes. To include quotes or double quotes within strings special formatting characters have to be used. The following are some of the formatting characters:
\' - single quote
|
|
Domain NamesJAVASCRIPT Types of Variables Arrays Data Type Conversion Arithmetic Operators Logical and Comparison Operators Assignment Operators Ternary Operators Operator Precedence Assignment Statements If StatementsSwitch Statement Function Call Statement Try, Catch and Throw Statements The For Loop Java While Loop The Do While Loop Break and Continue Statements
String Methods Array Methods Objects, Methods and Properties The Boolean Object The Date Object The Global Object The Math Object
The Number Object Color Constants Hierarchy of Browser Objects Window Object Document Object History Object Navigator Object Buttons Check Box Radio Buttons Text FieldsWorking with Image Maps Creating Simple Animation Hidden Fields Working with Style Sheets An Example of HTML Graphics Replacement The <SPAN> Tag Positioning of HTML Content The <LAYER> TagWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |