c-- styles for logos and headline links do not modify internet, red, or black styles -->

Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!

Some Other JavaScript Sources On IDM
·  JavaScript FAQ
· Basic JavaScript with Examples
·   Javascript Event Handlers
·   Putting JavaScript to Work
·   eXchange Thread: Javascript for Date Last Changed & Y2K
·   JS/Configurator: A Computer Cost Estimator
·   A Look at JavaScript in Microsoft IE vs. Netscape Communicator
·   JavaScript Forms and Frames: Enhancing HTML on the Client Side
·   JS/Configurator: A Computer Cost Estimator

Tutorial: Introduction to JavaScript


By Aaron Weiss

Operators

comparison

A comparison operator compares its operands and returns a logical value based on whether the comparison is true or not. The operands can be numerical or string values. When used on string values, the comparisons are based on the standard lexicographical (alphabetic) ordering.
== "Equal to" returns true if operands are equal.
=== Strict equality "Equal to" -- JavaScript 1.3+ only
!= "Not equal to" returns true if operands are not equal.
!== Strict equality "Not equal to" -- JavaScript 1.3+ only
> "Greater than" returns true if left operand is greater than right operand.
>= "Greater than or equal to" returns true if left operand is greater than or equal to right operand.
< "Less than" returns true if left operand is less than right operand.
<= "Less than or equal to" returns true if left operand is less than or equal to right operand.

The precise comparisons made using these operators varies between versions of JavaScript. In both JavaScript 1.3 and JavaScript 1.1 or earlier, these comparison operators perform a "type conversion" if necessary. In other words, if one operand is a string value and the other is a numeric value, JavaScript attempts to convert the string to numeric before performing the comparison (for instance, the string "5" would convert to the number 5).

In contrast, JavaScript 1.2 does not perform type conversion, and so if the two operands are of different types they cannot be legitimately compared. Finally, JavaScript 1.3+ also adds "strict equality" operators, === and !== (note the double equal signs). With a strict equality operator, the comparison will only yield a result if the two operands are of the same type.

JavaScript Tutorial   [Previous: Arithmetic or Computational | Next: Boolean]

[print version of this page]

IntranetDesignMagazine

 JavaScript Tutorial

Discuss
JavaScript
in the eXchange!


Contents
· VERSIONS OF JAVASCRIPT

· EMBEDDING JAVASCRIPT

· JAVASCRIPT GRAMMAR

· VARIABLES AND DATA TYPES

· OPERATORS
· Arithmetic or Computational
· Comparison
· Boolean
· String and Assignment
· Special
· Statements
· Conditionals
· Loops
· Object Manipulation
· Comments

· FUNCTIONS
· Defining Funtions
· Calling Functions

· OBJECTS
· Document Object Model
· Properties
· Methods
· Creating Objects

· EVENT HANDLERS

· CONCLUSION