我在玩靶场的时候被奇怪的行为绊倒了,我想:
(1...1).count
# => 0
(1...1).first(1)
# => []
(1...1).last(1)
# => []
(1...1).to_a
# => []
但
(1...1).first
# => 1
(1...1).last
# => 1
我是错过了什么,还是这是有意的行为?
发布于 2015-09-30 12:44:18
类似的- Range#end
.
https://stackoverflow.com/questions/32866229
复制相似问题