lexicographicallyPrecedes
官方网站说明
Returns a Boolean value indicating whether the sequence precedes another sequence in a lexicographical (dictionary) ordering, using the less-than operator (<) to compare elements.
lexicographic 是词典的意思。这个方法声明在 AnyCollection 里。会按照顺序比较两个集合元素的大小。大概意思是说 判断两个参数按照字典排序的顺序
Demo
let a = [1,2,3]
let b = [1,2,3,1]
a.lexicographicallyPrecedes(b) // true 1.2.3 < 1.2.3.1
let a = [1,2,3]
let b = [1,2,2]
a.lexicographicallyPrecedes(b) // flase 1.2.3 > 1.2.2