home / experts / javascript / column26 |
|
JavaScript 1.3 changes the way equality operators work, reverting back to JavaScript 1.1's rules. JavaScript 1.2 handles standard equality operators the same way JavaScript 1.3 handles strict equality operators (see previous page). When the operators are of different types, JavaScript 1.2 does not attempt to do any type conversion to help the comparison -- it always returns
returns Since JavaScript 1.3 explicitly supports strict equality operators ( The most common different-type-operand comparison is between a number and a string. The string is converted to a number via an elaborate algorithm. First, it is converted to a mathematical value. Then it is rounded to the nearest
When you compare a number and a
as well as this one:
When you compare an
|
| ||||||||||||||||||||
Created: September 28, 1998
Revised: September 28, 1998
URL: http://www.webreference.com/js/column26/equality.html