Ruby 实现 Array#reverse 性能
def reverse(arrays)
new_arrays = []
index = arrays.size - 1
while index >= 0
new_arrays << arrays[index]
index -= 1
end
new_arrays
end
Ruby 实现 Array#reverse 性能
def reverse(arrays)
new_arrays = []
index = arrays.size - 1
while index >= 0
new_arrays << arrays[index]
index -= 1
end
new_arrays
end