Availability: |
| ||||||||
Property/method value type: | Boolean primitive | ||||||||
JavaScript syntax: | - | anOperand1 <= anOperand2 | |||||||
Argument list: | anOperand1 | A value that can be compared numerically or lexically | |||||||
anOperand2 | A compatible value |
Returns true if the left operand is numerically less than or equal to the right operand or is sorted earlier or identically in the Unicode collating sequence when two string values are compared.
In numeric comparisons, the presence of NaN in either or both operands will yield undefined instead of true or false.
When comparing two strings, a prefixing plus sign is present, then a numeric coercion of a string takes place before the comparison. Numeric coercion takes place when either of the operands is numeric.
In ECMA compliant JavaScript implementations, string values are simply compared according to the Unicode character code point values, with no attempt to provide the more complex semantically oriented definitions of character and string equality defined in the Unicode version 2.0 specification.
The associativity is from left to right.
Refer to the operator precedence topic for details of execution order.
The result is the Boolean value true if anOperand1 is numerically or lexically less than or equal to anOperand2, otherwise false is returned.
ECMA 262 edition 2 - section - 11.8.3
ECMA 262 edition 2 - section - 11.8.5
ECMA 262 edition 3 - section - 11.8.3
ECMA 262 edition 3 - section - 11.8.5
Prev | Home | Next |
Less than (<) | Up | Letter |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |