Function sort
Source pub fn sort(args: &[Value]) -> Result<Value, RuntimeError>
Expand description
对数字数组进行排序
对数字数组进行升序排序,返回新的已排序数组。原数组不会被修改。
§返回值
Array - 升序排列的新数组
Set nums [3, 1, 4, 1, 5, 9, 2, 6]
Set sorted Sort(nums) # [1, 1, 2, 3, 4, 5, 6, 9]
Println(nums) # [3, 1, 4, 1, 5, 9, 2, 6] (原数组不变)