Relational expressions yield a Boolean result according to the relational test of the values either side of the operator.
Numerical values are compared according to sign and magnitude while string values are compared according to the Unicode collating sort sequence.
Relational operators will attempt to convert both arguments to a Number, and if at least one argument can be converted to a Number then the other will be forced to be a Number for comparison purposes. If both arguments are Strings or string-like objects, the relational test will be String-based.
If a prefixing plus sign is present, then a numeric coercion of a string takes place before the comparison.
// Force a string comparison myResult = (a+'' <= b+''); // Force a numeric comparison myResult = (a-0 <= b-0); // Force a boolean comparison myResult = (!a <= !b);
ECMA 262 edition 2 - section - 11.8
ECMA 262 edition 3 - section - 11.8