I recently discovered that arrays are orderable:
>> [1, 2] < [3, 4]
<- true
>> [1, 2] < [0, 4]
<- false
And by the looks of it, it seems that the two arrays are compared element by element, so if the first element in both arrays is equal, then the 2nd elements are compared, etc:
>> [1, 3] > [1, 2]
<- true
However, this assumption doesn't hold true with negative numbers:
>> [-1, 2] < [-2, 2]
<- true
>> -1 < -2
<- false
So, how are arrays actually ordered?
I've read through the Comparison operators docs at MDN, but I couldn't find any relevant information.