Language Reference |
Returns a Boolean value indicating the result of the comparison.
expression1 comparisonoperator expression2
The Comparison operator syntax has these parts:
Part Description expression1 Any expression. comparisonoperator Any comparison operator. expression2 Any expression.
When comparing strings, JScript uses the Unicode character value of the string expression.
The following is how the different groups of operators behave depending on the types and values of expression1 and expression2:
Relational (<, >, <=, >=)
Equality (==, !=)
- Attempt to convert both expression1 and expression2 into numbers.
- If both expressions are strings, do a lexicographical string comparison.
- If either expression is NaN, return false.
- Negative zero equals Positive zero.
- Negative Infinity is less than everything including itself.
- Positive Infinity is greater than everything including itself.
Identity (===. !==)
- If the types of the two expressions are different, attempt to convert them to string, number, or Boolean.
- NaN is not equal to anything including itself.
- Negative zero equals positive zero.
- null equals both null and undefined.
- Values are considered equal if they are identical strings, numerically equivalent numbers, the same object, identical Boolean values, or (if different types) they can be coerced into one of these situations.
- Every other comparison is considered unequal.
These operators behave identically to the equality operators except no type conversion is done, and the types must be the same to be considered equal.
© 1997 by Microsoft Corporation. All rights reserved.
|file: /Techref/inet/iis/jscript/htm/js427.htm, 3KB, , updated: 1997/9/30 03:44, local time: 2018/2/23 04:36,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/inet/iis/jscript/htm/js427.htm"> JScript Comparison Operators</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180223 RussellMc, Sean Breheny, Van Horn, David, David C Brown, Isaac M. Bavaresco, Darron Black, Harold Hallikainen, alan.b.pearce, Brent Brown, John Gardner,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!