Today working with task on JS I found that JavaScript out of the box have powerful comparison of arrays:
console.log(["a","b"] > ["a","aa"] && ['a','aa'] < ['a', 'cc']) // true
This leads to shortcut sorting for two dimensional arrays with strings
console.log([["a","aa"],['b','bb'],["a","c"],['b',"ab"],['b',"a"]].sort())
/*
[ [ 'a', 'aa' ],
[ 'a', 'c' ],
[ 'b', 'a' ],
[ 'b', 'ab' ],
[ 'b', 'bb' ] ]*/
JavaScript automatically order sub arrays with similar first element. Now I'm seek for formal definition how do JavaScript compares two arrays.