Untitled Document



 Introduction to HTML
 Structure of HTML
 Creating First HTML  Document
 Building Your HTML  Document
 Tables
 Frames
 Including Images into  Document
 Including Multimedia
 Developing HTML  FORMS
 Using Style Sheet
 Understanding URLs
 Using JavaScript
 Introducing JavaScript
   Using JavaScript
 Introducing to  JavaScript
   What is JavaScript?
 Why should you use  Java Script?
 Structure of a  JavaScript
   Syntax of JavaScript
 JavaScript
 Statements
 
 Statements
 Blocks
 
 Blocks
 Comments
 
   Comments
 Single-Line  Comments
 Multiline Comments
 Data
 
   Data
   Strings
   Numbers
   Boolean
 Null
 Expressions
 
   Expressions
   Numeric Expressions
 Logical Expressions
 Variables
 
   Variables
 Defining and Naming  Variables
 Changing the Value  of a Variable
 Functions
 
   Functions
   Built-in Functions
 User-Defined  Functions
 Returning Values  from Function
 Flow Control
 
   Flow Control
   If and if ....else
   If Statement
   If...else Statement
   IF Statement
   Looping Statements
   For Loops
   While Loops
   WHILE Statement
   Switch Statement
   Break Statement
 Continue Statement
 Objects
 
   Objects
   Methods
   Properties
   Built-in Objects
 User-defined Objects
 Arrays
 
 Arrays
 Event Handlers
 
   Event Handlers
 onMouseOver,  onMouseOut Events
 onClick, onChange  Events Handlers
 Using the onSubmit  Event Handler
 Introduction to Cookies
 
 Introduction to  Cookies
   Sessions Cookies
 Persistent Cookies
 Using Java

Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




  Using JavaScript > Expressions

  Expressions

Data by itself can be pretty useless. Normally, you want to do something with it. May be you want to divide two numbers by each other, add two numbers together, or perhaps check to see whether two sets of numbers added together are equal to one another. These are all uses of expressions.

  Numeric Expressions

A numeric expression is simply the rudimentary sort of mathematical operation that you're accustomed to, expect written out in its full form.

Example :

50 + 10      // Adding of two numbers
8 / 2            // Division of two numbers
48 % 7       // Modulo
-(15 * 6)     // Unary negation

  Logical Expressions

A logical (or Boolean) expression is that when evaluated returns a result of either true or false.

The most common Logical operations are given in the table:

Operator
Name
Usage
&&
And
(exp1 && exp2) returns true if both exp1 and exp2 are true, otherwise returns false.
||
Or
(exp1 && exp2) returns true only if either exp1 and exp2 are true.
!
Not
(!exp) returns false only if exp1 is true, or true of exp is false.
= =
Equal
(exp1 = = exp2) returns true only if exp1 is equal to exp2.
! =
Not Equal
(exp1! = exp2) returns true only if exp1 is not equal to exp2.
>
Greater than
(exp1> exp2) returns true only if exp1 is greater than exp2.
>=
Greater than or Equal
(exp1>= exp2) returns true only if exp1 is greater than or equal to exp2.
<
Less than
(exp1< exp2) returns true only if exp1 is less than exp2.
<=
Less than or Equal
(exp1<= exp2) returns true only if exp1 is less than or equal to exp2.

Back Next


Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




17, Vadsarvala Nivas, 65-A, J. Nehru Road, Mulund (W), Mumbai - 400 080 INDIA
Tel : 91-22-25795588, 91-22-25780444 Fax : 91-22-25793397
Email : ionline@vsnl.com
© Image Online 2001-2003