The comparison operators (<, <=, ==, >=, >) are clearly core to any programming language. The AS3 docs tell us a little about AS3’s special handling of strings when compared, but there is more to the story.

As the aforementioned docs say, strings are compared character-by-character:

"hello" == ("h"+"ello"); // true
"hello" == "goodbye"; // false
"aaa" < "bbb"; // true
"aaa" > "bbb"; // false
"aaaa" < "aaa"; // false, length matters
"aaaa" > "aaa"; // true, length mattering confirmed
"aaaa" < "bbb"; // true, first comparison means length is not a tie-breaker
"apple" > "aardvark"; // true

Most AS3 programmers know this language feature, which is not present in languages like Java and C++. Not many AS3 programmers know that the same comparison magic works with arrays and vectors. Well, almost:

[1,2,3] < [2,4,6]; // true
[1,2,3] > [2,4,6]; // false
[1,2,3] == [1,2,3]; // false
Vector.<int>([1,2,3]) < Vector.<int>([2,4,6]); // true
Vector.<int>([1,2,3]) > Vector.<int>([2,4,6]); // false
Vector.<int>([1,2,3]) > Vector.<int>([1,2,3]); // false

Arrays and vectors are compared element-by-element. Less-than and greater-than operators work, but equality is still strict. You can see the language designer’s point here: you usually want to compare pointers rather than every element. Still, they could have made use of the === operator for that. So, now that you know all of that I never want to see any more manual loops; they’re just silly.