< (less than)
Top  Previous  Next


SWiSH Player Support
SWF4 or later - Supported Internally

Syntax
expression1 < expression2

Arguments
expression1,expression2 can be numbers, strings or variables.

Returns
None.

Description
Operator (comparison): compares two expressions and determines whether expression1 is less than expression2; if so, the operator returns true. If expression1 is greater than or equal to expression2, the operator returns false.

String constants are converted to numeric unless both expressions are string constants.
Variables are assumed to be numeric. Possibly undergoing a conversion.

Mixed numeric / string comparisons can give unusual results.
If string comparison is intended, use the lt operator.

Sample
The following examples illustrate true and false returns for both numeric and string comparisons.
3
 < 10;
// true


10
 < 3;
// false


"a" < "cat";
// true


a = "a";
b = "b";
b < a;
// true.
Possibly not what is expected but caused by conversion of strings to numeric 0. Use the lt operator instead.

See Also
lt