BT编程语言文档
reduce_right
与reduce相同,但从右向左执行语法 Array.reduce_right(callback:Fn(acc:Any, value:Any, key:Int), initialValue:Any)
arr = [1, 2, 3, 4] println arr.reduce_right(fn(acc, v){ acc + v }, 0) // 输出:10语法 Array.reduce_right(callback:Fn(acc:Any, value:Any, key:Int), initialValue:Any)
arr = [1, 2, 3, 4] println arr.reduce_right(fn(acc, v){ acc + v }, 0) // 输出:10