val names = arrayOf("Alice", "Bob", "Charlie") // 按名字长度对数组进行排序 // 按名字长度对数组进行排序: [Bob, Alice, Charlie] names.sortedArrayWith { n1, n2 -> n1.count() - n2.count() }.forEach { _console.log(it) }